提交时间:2024-01-26 14:38:55
运行 ID: 128986
#include <bits/stdc++.h> using namespace std; int maxn=100000; 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; }