Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97674 | 王思颜 | 判断素数II | C++ | Compile Error | 0 MS | 0 KB | 315 | 2024-11-16 12:10:31 |
#include<bits/stdc++.h> using namespace std; int he(int b){ if (b < 2){ return 0; } for (int i = 2;i < b;i++){ if (x % i == 0){ return 0; } } return 1; } int main(){ int n,a,m = 0; cin>>n; for (int j = 2;j <= n;j++){ a = he(i); if (a == 1){ m++; } } return 0; }
Main.cc: In function 'int he(int)': Main.cc:8:7: error: 'x' was not declared in this scope if (x % i == 0){ ^ Main.cc: In function 'int main()': Main.cc:19:10: error: 'i' was not declared in this scope a = he(i); ^