Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
336585 123456 【C4-4】优秀成绩的平均分 C++ 通过 100 1 MS 244 KB 315 2025-07-29 11:12:02

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main(){ int n,a[105],s=0; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=n;i>1;i--) for(int j=1;j<i;j++) if(a[j]<a[j+1]) swap(a[j],a[j+1]); for(int i=1;i<=5;i++) s+=a[i]; cout<<fixed<<setprecision(1)<<1.0*s/5<<endl; return 0; }


测评信息: