提交时间:2024-01-26 16:02:01

运行 ID: 129057

#include<bits/stdc++.h> using namespace std; int main() { int i,j,t; bool a[114514]={0}; for(i=2;i<=sqrt(100000);i++) {if(!a[i]) {for(j=2;i*j<=100000;j++) a[i*j]=1;}} for(i=2;i<=100000;i++) {if(!a[i]) cout<<i<<endl;} }