Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
127847 陈冠樾 18高于平均分的学生数量 C++ Compile Error 0 MS 0 KB 346 2025-07-29 15:50:21

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int sum = 0; for (int i = 0; i < n; i++) { sum = sum + a[i]; } int d=sum / n int c = 0; for (int j = 0; j < n; j++) { if (a[j] <d ) { c++; } cout << c; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:15:2: error: expected ',' or ';' before 'int'
  int c = 0;
  ^
Main.cc:18:4: error: 'c' was not declared in this scope
    c++;
    ^
Main.cc:20:11: error: 'c' was not declared in this scope
   cout << c;
           ^