Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
114200 | 胡盛哲 | 素数检测 | C++ | Compile Error | 0 MS | 0 KB | 328 | 2025-03-22 11:08:18 |
#include <bits/stdc++.h> using namespace std; int is[3000001]; int main() { for(int i=2;is<=300;i++){ if(is[i]==1){ continue; } for(int j=2*i;j<=300;j+=i){ is[j]=1; } if(i*i>300){ break; } } for(int i=2;i<=300;i++){ if(is[i]==0){ cout << i<< " " ; } } return 0; }
Main.cc: In function 'int main()': Main.cc:5:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(int i=2;is<=300;i++){ ^