Problem Description
Input from the keyboard 10 student achievement, averaging scores higher than average scores and results
Entry
** 10 ** integer
Export
** the first line, the average score, Reserved 1 decimal.
The second line, above the average score, after each performance spaces. **
Sample input
60 60 60 70 70 70 80 80 80 70
Sample Output
70.0
80 80 80
AC Code
#include <iostream>
using namespace std;
int main()
{
int m[10];
float ave;
int sum = 0;
for(int i = 0; i < 10; i++)
{
cin >> m[i];
sum += m[i];
}
ave = sum / 10.0;
printf("%.1f\n",ave);
for(int j = 0; j < 10; j++)
{
if(ave < m[j])
{
cout << m[j] << " ";
}
}
return 0;
}