提交时间:2024-01-26 14:37:57
运行 ID: 128983
#include <bits/stdc++.h> using namespace std; int maxn=1000000; bool check(int x) { for(int i=2;i*i<=x;i++) if(x%i==0) return false; return true; } int main() { for(int i=2;i<=maxn;i++) if(check(i)) cout<<i<<" "; return 0; }