Program hotrotinhoc;
var i,n,s,k,max,n1: longint;
begin
write('Nhap N='); readln(n);
max:=0; n1:=n;
while n<>0 do
begin
k:=n mod 10;
s:=s*10+k;
n:=n div 10;
if k>max then max:=k;
end;
writeln('Chu so lon nhat cua so tu nhien vua nhap la :',max);
If s=n1 then write('La so doi xung') else write('Khong phai so doi
xung');
readln
end.
uses crt;
var n,i,d,x,ln,kt:word;
st:string;
a:array[1..100]of integer;
begin
clrscr;
write('nhap n='); readln(n);
str(n,st);
d:=length(st);
for i:=1 to d do
val(st[i],a[i],x);
ln:=0;
for i:=1 to d do
if ln<a[i] then ln:=a[i];
writeln('chu so lon nhat trong so ',n,' la: ',ln);
{-----------------------kiem-tra-doi-xung----------------------------}
kt:=0;
for i:=1 to d do
if a[i]<>a[d+1-i] then kt:=1;
if kt=0 then writeln('day la so doi xung')
else writeln('day khong la so doi xung');
readln;
end.