Program n1; var s: string; i,n: byte; c: char; begin write('введите строку: '); readln(s); n := length(s) div 2; for i := 1 to n do begin c := s[i]; s[i] := s[length(s)-i+1]; s[length(s)-i+1] := c; end; writeln('перевернутая строка: ',s); readln end.
Answers & Comments
Verified answer
Program n1;var s: string;
i,n: byte;
c: char;
begin
write('введите строку: ');
readln(s);
n := length(s) div 2;
for i := 1 to n do begin
c := s[i];
s[i] := s[length(s)-i+1];
s[length(s)-i+1] := c;
end;
writeln('перевернутая строка: ',s);
readln
end.