Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6940 邓小龙 18统计成绩 C++ Accepted 0 MS 256 KB 432 2025-03-29 09:27:16

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[101],n,_max=0,_min=101,tot; double ave; int main(){ cin>>n;//录入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; return 0; }