

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
uses crt,math;
var n,i,k:longint;
function ngto(n:longint):boolean;
var i:longint;
begin
if n<2 then exit(false);
for i:=2 to round(sqrt(n)) do
if n mod i=0 then exit(false);
exit(true);
end;
function kt(n:longint):boolean;
var i:longint;
begin
i:=1;
while 2**i-1<n do
i:=i+1;
if 2**i-1<>n then exit(false)
else
kt:=ngto(i)=true;
end;
begin
clrscr;
readln(n);
k:=0;
for i:=1 to n do
if ngto(i) then
if kt(i) then
begin
k:=k+1;
write(i,' ');
end;
if k=0 then write('KHONGCO');
readln
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
Bảng tin
878
16288
459
alo sửa lỗi hộ bài này vì tui dùng while kém
1428
25173
482
Bài này là bài nào :))??
878
16288
459
https://hoidap247.com/cau-hoi/5509607
0
16
0
https://hoidap247.com/cau-hoi/5511074
1887
26084
1060
tháng này leo top kìa