Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
87913 | 王馨桐 | 18统计成绩 | C++ | Accepted | 1 MS | 272 KB | 366 | 2024-08-16 11:50:32 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; int s[101]; double sum=0,pj; int mx=-2e9,mn=2e9; cin >>n; for(int i=0; i<n; i++){ cin >>s[i]; } for(int i=0; i<n; i++){ sum +=s[i]; if(s[i]>mx){ mx=s[i]; } if(s[i]<mn){ mn=s[i]; } } pj=sum/n; printf("%.0lf %.2lf %d %d",sum,pj,mx,mn); return 0; }