20
10
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
81
522
Var n,i:integer;
Function nt(x:integer):boolean;
Var i:integer;
BeginNt:=false;
If x<2 then exit;
For i:=2 to trunc(sqrt(x)) doIf x mod 2=0 then exit;
Nt:=true;
BeginWrite(‘nhap n:’);
readln(N);
For i:=2 to n doIf nt(i) then write(i,’ ‘);
Readln
End.
Hãy giúp mọi người biết câu trả lời này thế nào?
114
55
Function ktnt(x:integer):boolean;
begin
Ktnt:=true;
For j:=2
to round(sqrt(n)) do if n mod i =0 then
Begin
Ktnt:=false;
Break;
End;
end;
begin
...
for i:=1 to n do if ktnt(i)=true then write(i,’ ‘);
...
end;//nhap xuat tu lam
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin