1:
uses crt;
var n,kt,i:integer;
begin
clrscr;
write('n='); readln(n);
kt:=0;
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then kt:=1;
if kt=0 then writeln(n,' la so nguyen to')
else writeln(n,' khong la so nguyen to');
readln;
end.
2:
uses crt;
var n:longint;
i,t,d,x,y:integer;
st:string;
begin
clrscr;
write('n='); readln(n);
str(n,st);
t:=0;
d:=length(st);
for i:=1 to d do
begin
val(st[i],x,y);
t:=t+x;
end;
if (n>=10000) and (n<=99999) then writeln('tong cac chu so cua ',n,' la: ',t)
else writeln('vui long nhap so co 5 chu so');
readln;
end.