uses crt;
var n,dv,ch,t:byte;
begin
clrscr;
repeat
write('nhap n='); readln(n);
if (n<10) or (n>99) then writeln('vui long nhap lai');
until (10<=n) and (n<=99);
{-------------------------------cau-1--------------------------------}
dv:=n mod 10;
writeln('chu so hang don vi cua ',n,' la: ',dv);
ch:=n div 10; ch:=ch mod 10;
writeln('chu so hang chuc cua ',n,' la: ',ch);
{-------------------------------cau-2--------------------------------}
t:=dv+ch;
writeln('tong cac chu so cua ',n,' la: ',t);
readln;
end.
uses crt;
var n:integer;
begin
clrscr;
repeat
write('Nhap so n: '); readln(n);
if (n > 99) or (n < 10) then
begin
write('Hay nhap so co 2 chu so');
delay(2000);
clrscr;
end;
until (n < 100) and (n > 9);
writeln('Chu so hang chuc la: ',n div 10);
writeln('Chu so hang don vi la: ',n mod 10);
write('Tong cac chu so cua ',n,' la: ',(n div 10) + (n mod 10));
readln
end.