Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5096 | 郑元泰 | 计算平均数 | C++ | Wrong Answer | 0 MS | 260 KB | 506 | 2024-11-02 14:15:25 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[5],s=0; for(int i=0;i<5;i++){ cin>>a[i]; s+=a[i]; } double average=s*1.0/5; printf("%.21f\n",average); for(int i=0;i<5;i++){ if(a[i]>average) cout<<a[i]<<" "; } return 0; }
------Input------
986 438 342 699 699
------Answer-----
632.80 986 699 699
------Your output-----
632.799999999999954525265 986 699 699