// arrayscores.cxx:  This program reads SIZE elements into
//                   an array, calculates the average of the
//                   elements, and outputs those elements
//                   greater than or equal to the average

#include <iostream>
#include <iomanip>

using namespace std;

const int SIZE=10;

int main()
{
  float total,         // sum of all the scores
        scores[SIZE];  // array of scores

  for (int count=0; count < SIZE; count++)
    {
      cin >> scores[count];
      cout << setw(5) << scores[count];     // echo-print
    }

  // add all the scores together

  total = 0.0;
  for (int count=0; count < SIZE; count++)
    total += scores[count];

  total = total / SIZE;
  cout << endl << "average = " << total << endl;

  cout << "Scores above average: " << endl;
  for (int count=0; count < SIZE; count++)
    {
      if(scores[count] >= total)
	cout << setw(5) << scores[count] << endl;
    }
  return 0;
}
