Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
336254 小林老师 【C4-1】找找谁的身高超过全家的平均身高 C++ 通过 100 2 MS 256 KB 364 2025-07-26 10:11:49

Tests(3/3):


#include<bits/stdc++.h> using namespace std; int main(){ int n; double AVE, sum=0.0; int a[12]; cin>>n; for(int i=0; i<n; i++){ cin>>a[i]; } for(int i=0; i<n; i++){ sum+=a[i]; } AVE=sum/n; cout<<fixed<<setprecision(1)<<"AVE="<<AVE<<endl; for(int i=0; i<n; i++){ if(a[i]>AVE){ cout<<i+1<<":"<<a[i]<<" "; } } return 0; }


测评信息: