| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 76260 | 刘千亦 | 计算平均数 | C++ | Compile Error | 0 MS | 0 KB | 344 | 2024-06-02 09:34:26 |
#include<iomanip> using namespace std; int main(){ int a[100] = {0}; double s=0; for(int i=1;i<=5;i++){ cin>>a[i]; s += a[1]; } double avg = s/5; cout<<fixed<<setprecision(2)<<avg<<endl; // print("%.2lf\n",avg); for(int i=1;i<=5;i++){ if(a[i]>avg){ cout<<a[i]<<" "; } } }
Main.cc: In function 'int main()':
Main.cc:7:8: error: 'cin' was not declared in this scope
cin>>a[i];
^
Main.cc:11:4: error: 'cout' was not declared in this scope
cout<