1 条题解
-
0
(访客模式)Guest
-
0
C++ :
#include<iostream> #include<cstring> using namespace std; bool a[10005]; int main(){ memset(a,true,sizeof(a)); for (int i=2; i<=100; i++) if (a[i]) for (int j=2*i; j<=10000; j+=i) a[j]=false; int t=0; for (int i=2; i<=10000; i++) if (a[i]){ cout<<i; t++; if (t%10==0) cout<<endl; else cout<<" "; } cout<<endl; return 0; }
- 1
信息
- ID
- 696
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者