Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121179 韩潞琪 18高于平均分的学生数量 C++ Compile Error 0 MS 0 KB 317 2025-06-07 08:54:33

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a[101],n,s=0,; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; p+=a[i]; } p=p/5; for(int i=1;i<=n;i++){ if(a[i]>p){ s+=1; } } cout<<s; //printf("%.2f",p); //cout<<' '<<d<<' '<<x<<' '; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:22: error: expected unqualified-id before ';' token
     int a[101],n,s=0,;
                      ^
Main.cc:9:6: error: 'p' was not declared in this scope
      p+=a[i];
      ^
Main.cc:11:2: error: 'p' was not declared in this scope
  p=p/5;
  ^