Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
116613 | 何松羽 | 计算平均数 | C++ | Accepted | 1 MS | 276 KB | 346 | 2025-04-12 11:59:24 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; n=5; int a[n]; int s=0; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<=n-1;i++){ s=s+a[i]; } float b=0; b=s*1.0/n; printf("%.2f\n",b); for(int i=0;i<=4;i++){ if(a[i]>b){ cout<<a[i]<<" "; } } return 0; }