Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103163 | 糜宗易 | 计算平均数 | C++ | Wrong Answer | 1 MS | 272 KB | 335 | 2024-12-28 12:26:56 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; n=5; int a[n]; for(int i=0;i<=n-1;i++){ cin>>a[i]; } int s=0; for(int i=0;i<=n-1;i++){ s=s+a[i]; } float sum; printf("%.2f\n",sum=s/5); for(int i=0;i<=4;i++){ if(a[i]>sum){ cout<<a[i]<<" "; } } return 0; }
------Input------
679 849 98 256 256
------Answer-----
427.60 679 849
------Your output-----
427.00 679 849