| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 84079 | 胡盛哲 | 判断素数II | C++ | Compile Error | 0 MS | 0 KB | 296 | 2024-07-15 11:28:03 |
#include<bits/stdc++.h> using namespace std; bool iszs(int a) { for(int j=2; j<a; j++) { if(a%j==0) { return false; } } return true; } int main() { int n;sum=0; cin>> n; for(int i=2;i<=n;i++){ if(iszs(i)){ sum++; } } } return 0; }
Main.cc: In function 'int main()':
Main.cc:14:11: error: 'sum' was not declared in this scope
int n;sum=0;
^
Main.cc: At global scope:
Main.cc:22:1: error: expected unqualified-id before 'return'
return 0;
^
Main.cc:24:1: error: expected declaration before '}' token
}
^