uses crt;
var a,x:longint;
{------------------ham-kiem-tra-so-nguyen-to---------------}
function ktnt(x:longint):boolean;
var kt:boolean;
i:longint;
begin
kt:=true;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then
begin
kt:=false;
break;
end;
if kt=true then ktnt:=true
else ktnt:=false;
end;
{---------------chuong-trinh-chinh-------------------}
begin
clrscr;
repeat
write('Nhap a='); readln(a);
until a>10;
if ktnt(a)=true then
begin
x:=a;
repeat
a:=a div 10;
if ktnt(a)=true then a:=a div 10;
until a<10;
if (ktnt(a)=true) and (a>1) then writeln(x,' la so sieu nguyen to')
else writeln(x,' khong la so sieu nguyen to');
end
else writeln(a,' khong la so sieu nguyen to');
readln;
end.
bn ơi cấu hỏi hơi bị khó hiểu xíu