Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
87743 | 张曦 | 计算平均数 | C++ | Accepted | 1 MS | 276 KB | 417 | 2024-08-12 10:46:52 |
#include <bits/stdc++.h> using namespace std; int main() { int a[5]; float d=0; for(int i = 0;i<=4;i++) cin>>a[i]; for(int i = 0;i<=4;i++) d+=a[i]; d=d/5; cout<<fixed<<setprecision(2)<<d<<endl; for(int i = 0;i<=4;i++) { if(a[i]>d) cout<<a[i]<<' '; } return 0; }