Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
104574 | 石水生 | 计算平均数 | C++ | Compile Error | 0 MS | 0 KB | 233 | 2025-01-05 14:19:28 |
#include <bits/stdc++.h> using namespace std; int main(){ int a[5]; double sum=0; for(int i=0;i<n;i++){ cin>>a[i]; sum+=a[i]; } printf("%.2f",sum/5); for(int i=0;i<n;i++){ if(a[i]>sum/5) cout<<a[i]<<' '; } }
Main.cc: In function 'int main()': Main.cc:6:16: error: 'n' was not declared in this scope for(int i=0;i