Bài 1:
uses crt;
var n,i,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
kt:=0;
for i:=2 to n-1 do
if n mod i=0 then kt:=1;
if (kt=0) and (n>1) then writeln(n,' la so nguyen to')
else writeln(n,' khong la so nguyen to');
readln;
end.
Bài 2:
uses crt;
var n,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
if n mod i=0 then write(i:4);
readln;
end.