const
maxn=1000000007;
var
bz:array[1..2000000] of boolean;
ss:array[0..1000000] of longint;
i,j,n,t:longint;
begin
readln(n);
fillchar(bz,sizeof(bz),true);
for i:=2 to n do
begin
if bz[i] then
begin
inc(ss[0]);
ss[ss[0]]:=i;
end;
for j:=1 to ss[0] do
begin
if n/ss[j]<i then break;
bz[i*ss[j]]:=false;
if i mod ss[j]=0 then break;
end;
end;
for i:=1 to ss[0] do write(ss[i],' ');
文章标题
最新推荐文章于 2022-06-12 17:07:04 发布