Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
128986 | daichenxi | 求素数 | C++ | 通过 | 100 | 8 MS | 236 KB | 249 | 2024-01-26 14:38:55 |
#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; }