Uses crt;
Var i:integer;
s1,s2:string;
Begin
clrscr;
Writeln('Nhap xau:');readln(s1);
s2:=''
i:=length(s1);
While s1[i]<> ' ' do
Begin
s2:=s2+s1[i];
i:=i-1;
End;
Writeln('Tu sau cung cua xau la:');
For i:=length(s2) downto 1 do write(s2[i]);
readln;
End.
uses crt;
var st,s:string;
i,d:integer;
begin
clrscr;
readln(st);
d:=length(st);
s:=''
i:=d;
while st[i]<>#32 do
begin
s:=s+st[i];
i:=i-1;
end;
for i:=length(s) downto 1 do
write(s[i]);
readln;
end.