东方博宜 1231. 考试成绩的分布情况
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n ;
cin >> n ;
int a[101] ;
for(int i = 0 ; i < n ; i++)
{
cin >> a[i] ;
}
double sum ;
sum = 0 ;
for(int j = 0 ; j < n ; j++)
{
sum += a[j] ;
}
double ping = 0 ;
ping = sum / n * 1.0 ;
int da , xiao ;
da = 0 ;
xiao = 0 ;
for(int i = 0 ; i < n ; i++)
{
if(a[i] >= ping)
da += 1 ;
else
xiao += 1;
}
cout << fixed << setprecision(1) << ping <<" "<<da<<" " << xiao;
return 0 ;
}