Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99123 | 潘梓骞 | 计算平均数 | C++ | Accepted | 1 MS | 268 KB | 304 | 2024-11-24 13:38:24 |
#include<bits/stdc++.h> using namespace std; double t,e; int main(){ int a[5]; for(int i=0;i<5;i++){ cin>>a[i]; } for(int i=0;i<5;i++){ t=t+a[i]; } cout<<fixed<<setprecision(2)<<t/5<<endl; e=t/5; for(int i=0;i<5;i++){ if(a[i]>e){ cout<<a[i]<<" "; } } return 0; }