Program HOC24;
var s,s1: string;
i: byte;
begin
write('Nhap xau: '); readln(s);
for i:=length(s) downto 1 do s1:=s1+s[i];
if s=s1 then write('Xau doi xung') else write('Xau khong doi xung');
readln
end.
*Cách khác:
uses crt;
var st:string;
i,d,kt:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
kt:=0;
for i:=1 to d do
if st[i]<>st[d-i+1] then kt:=1;
if kt=0 then writeln('Xau doi xung')
else writeln('Xau khong doi xung');
readln;
end.