Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
130127 周民苡 计算平均数 C++ Compile Error 0 MS 0 KB 274 2025-09-07 17:05:20

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:7: error: 'n' was not declared in this scope
  cin>>n;
       ^