文章标题

来源:互联网 发布:ip反查域名的网站 编辑:程序博客网 时间:2024/06/06 02:01
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],' ');
原创粉丝点击