Thứ Sáu, 8 tháng 7, 2022

CSMAX PASCAL

var n,maxx,x:longint;
begin
    assign(input,'csmax.inp');reset(input);
    assign(output,'csmax.out');rewrite(output);
    read(n);
    maxx:=0;
    while n>0 do
    begin
          x:=n mod 10;            //lay cs cuoi cua n
           if x>maxx then maxx:=x;
        n:=n div 10;            //bo cs cuoi cua n
       end;
    write(maxx);
end.

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.