Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5293 | 邓小龙 | 18统计成绩 | C++ | Accepted | 0 MS | 264 KB | 531 | 2024-11-09 14:49:24 |
#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 n,d=100,g=-1,a[110]; double tot,ave; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; tot+=a[i]; if(g<a[i]) g=a[i]; if(d>a[i]) d=a[i]; } ave=tot/n*1.0; printf("%.0lf %.2lf %d %d\n",tot,ave,g,d); return 0; }