Var f,s:text; st,sp:string; i:integer; c:char; begin assign(s,'text1.txt'); reset(s); while not Eof(s) do begin; readln(s,sp); st:=st+sp+chr(10)+chr(13); end; close(s); for i:=1 to length(st) div 2 do begin c:=st[i]; st[i]:=st[length(st)-i+1]; st[length(st)-i+1]:=c; end; assign(f,'text.txt'); rewrite(f); write(f,st); close(f); end.
Текст в файле text1.txt:
Simple text 1And another simple text 2New text
Текст в файле text.txt: txet weN2 txet elpmis rehtona dnA1 txet elpmiS
function IsPositive(a:integer):boolean; begin result:=(a>-1); end;
procedure work; var min, max, count:integer; begin count:=0; min:=m[0]; max:=0; for i:=0 to 14 do begin if IsPositive(m[i]) then begin inc(count); if m[i]>max then max:=m[i]; if m[i]<min then min:=m[i]; end; end; writeln('MAX: ', max); writeln('MIN: ', min); writeln('Count: ', count); end;
begin for i:=0 to 14 do begin write('n: '); readln(m[i]); end;