Var n,i,souoc:integer;
Begin
Write('Nhap N = ');readln(n);
souoc:=0;
For i:=1 to n do
If n mod i = 0 then souoc:=souoc+1;
If souoc=2 then write(n,' la so nguyen to')
Else write(n,' khong la so nguyen to');
Readln;
End.
program KiemTraSoNguyenTo;
var
N, i: integer;
IsPrime: boolean;
begin
write('Nhap N: ');
readln(N);
IsPrime := true;
if (N < 2) then
IsPrime := false
else
for i := 2 to trunc(sqrt(N)) do
if (N mod i = 0) then
begin
IsPrime := false;
break;
end;
if IsPrime then
writeln(N, ' la so nguyen to')
else
writeln(N, ' khong la so nguyen to');
readln;
end.