Câu 3:
uses crt;
var n,i,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
if n>1 then
begin
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,' la hop so');
end
else writeln(n,' khong la so nguyen to cung khong la hop so');
readln;
end.