Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111120 | 万隽宇 | 素数检测 | C++ | Time Limit Exceeded | 1000 MS | 268 KB | 499 | 2025-02-27 18:31:34 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; bool c(int x){ for(int b=2;b<=x/2;b++){ if(x%b==0){ return false; } } return true; } int main(){ for(int i=2;i<=3000000;i++){ if(c(i)){ cout<<i<<' '; } } return 0; }