uses crt;
var n,a,b,c:integer;
begin
clrscr;
writeln('nhap vao so n la');readln(n);
writeln('cac chu so trong so n la');
if (n>=1000) and (n<=3000) then begin
a:=n mod 10; writeln(a:4);
n:=n div 10;
b:=n mod 10; writeln(b:4);
n:=n div 10;
c:=n mod 10; writeln(c:4);
n:=n div 10; writeln(n:4);end
else writeln('khong xac dinh');readln;end.
USES crt;
VAR n:longint; i:byte;s:string;
BEGIN
clrscr;
write('Nhap n:');readln(n);
str(n,s);
writeln('Cac chu so cua ',n,' la:');
for i:=1 to length(s) do
write(s[i]:4);
readln;
END.
program bai1;
var n,du:longint;
begin
repeat
write('N= ');readln(n);
until ((n>=1000) and (n<=3000));
write('Cac chu so cua ',n,' la ');
while n<>0 do
begin
du:=n mod 10;
write(du,' ');
n:=n div 10;
end;
readln
end.