提交时间:2019-11-25 19:06:31

运行 ID: 2433

#include<iostream> #include<cstdio> using namespace std; int h[105]; int main(){ int n; double ave=0; cin>>n; for (int i=1; i<=n; i++){ cin>>h[i]; ave += h[i]; //累加身高 } ave /= n; //平均身高 printf("%.1f\n",ave); for (int i=1,first=0; i<=n; i++) if (h[i]>ave){ if (++first>1) cout<<" "; cout<<i<<":"<<h[i]; } cout<<endl; return 0; }