Var s:string; i:integer; Begin Readln(s); i:=length(s); while (i>0) and (s [ i]=' ') do i:=i-1; if i=0 then Writeln('слова в строке не обнаружены') else repeat Write(s[ i]); i:=i-1 until (i=0) or (s[ i]=' '); End.
Var s: string;i,n: byte;c: char; begin 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); end.
Begin
Readln(s); i:=length(s);
while (i>0) and (s [ i]=' ') do i:=i-1;
if i=0 then Writeln('слова в строке не обнаружены')
else repeat Write(s[ i]); i:=i-1 until (i=0) or (s[ i]=' ');
End.
s: string;i,n:
byte;c: char;
begin
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);
end.