| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 78001 | 李雨昊 | 18统计成绩 | C++ | Accepted | 0 MS | 272 KB | 438 | 2024-06-16 08:56:17 |
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<iomanip> using namespace std; int main(){ int n,x=100,m=0; double h=0,avg=0; cin>>n; int a[101]; for(int i=0;i<n;i++){ cin>>a[i]; h+=a[i]; } for(int i=0;i<n;i++){ if (a[i]>m){ m=a[i]; } if (a[i]<x){ x=a[i]; } } avg=h/n; cout<<h<<" "; cout<<fixed<<setprecision(2)<<avg; cout<<" "<<m<<" "<<x; }