uses crt;var n,i,kt:longint; s:string;beginclrscr; write(‘n=’);readln(n); str(n,s); for i:=1 to length(s) do if s[i]<>s[length(s)-i+1] then kt:=1; writeln(kt=0);readln;end. Bình luận
Uses crt; var st: string; function KT (xau: string): boolean; var i, dem: integer; begin dem:=0; for i:= 1 to length(st) div 2 do if xau<>xau[length(xau)-i+1] then inc(dem); if dem<>0 then KT:=False else KT:=True; end; begin clrscr; write (‘Nhap so co do dai khong qua 100 chu so: ‘); readln (st); if length(st)>100 then begin write (‘Nhap khong hop le! An Enter va chay lai!’); readln; exit; end; if KT(st)=True then write (‘Day la so doi xung!’) else write (‘Day la so khong doi xung!’); readln; end. Bình luận
uses crt;
var n,i,kt:longint; s:string;
begin
clrscr;
write(‘n=’);readln(n);
str(n,s);
for i:=1 to length(s) do if s[i]<>s[length(s)-i+1] then kt:=1;
writeln(kt=0);
readln;
end.
Uses crt;
var st: string;
function KT (xau: string): boolean;
var i, dem: integer;
begin
dem:=0;
for i:= 1 to length(st) div 2 do
if xau<>xau[length(xau)-i+1] then
inc(dem);
if dem<>0 then
KT:=False
else
KT:=True;
end;
begin
clrscr;
write (‘Nhap so co do dai khong qua 100 chu so: ‘);
readln (st);
if length(st)>100 then
begin
write (‘Nhap khong hop le! An Enter va chay lai!’);
readln;
exit;
end;
if KT(st)=True then
write (‘Day la so doi xung!’)
else
write (‘Day la so khong doi xung!’);
readln;
end.