Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103182 | 何松羽 | 计算平均数 | C++ | Compile Error | 0 MS | 0 KB | 331 | 2024-12-28 12:53:01 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; n=5; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<=4;i++){ s=s+a[i]; } float b=0; b=s*1.0/5; printf("%.2f\n",b); for(int i=0;i<=0;i++){ if(a[i]>b){ cout<<a[i]<<" "; } } return 0; }
Main.cc: In function 'int main()': Main.cc:11:4: error: 's' was not declared in this scope s=s+a[i]; ^ Main.cc:14:6: error: 's' was not declared in this scope b=s*1.0/5; ^