Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6942 刘芃伽 18统计成绩 C++ Accepted 0 MS 256 KB 359 2025-03-29 09:34:11

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[101],n,_max,_min=101,tot; double ave; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; tot+=a[i]; _max=max(a[i],_max); _min=min(a[i],_min); } ave=tot*1.0/n; cout<<tot<<' '<<fixed<<setprecision(2)<<ave<<' ' <<_max<<' '<<_min<<endl; }