Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
106961 | 周琨智 | 18高于平均分的学生数量 | C++ | Compile Error | 0 MS | 0 KB | 361 | 2025-01-17 10:21:36 |
using namespace std; int main() { int d; d = 0; int c; cin >> c; int f = 0; int a[c]; double b; double s; s = 0; for (int i = 0; i <= c - 1; i++) { cin >> a[i]; } for (int i = 0; i <= c - 1; i++) { s = s + a[i]; } b = s / c; for (int i = 0; i <= 4; i++) { if (a[i] > b) { f ++; } } cout << f; return 0; }
Main.cc: In function 'int main()': Main.cc:6:2: error: 'cin' was not declared in this scope cin >> c; ^ Main.cc:25:2: error: 'cout' was not declared in this scope cout << f; ^