/*
This program declares an array of type int and size entered by user 
(but notice that
the maximu size is 50), reads the array,
and finds the sum and average of the array. 
*/

#include <iostream>
using namespace std;
int main()
{
	const int n = 50;
	int a[n], i, sum = 0, size;
	cout << "Enter the size of the array: ";
	cin >> size;
	cout << "Enter " << size << " integers: ";
	for (i = 0; i < size; i++)
		cin >> a[i];

	// Print a (all values of a)
	for (i = 0; i < size; i++)
		cout << a[i] << '\t';
	cout << endl;
	
	for (i = 0; i < size; i++)
		sum += a[i];

	cout << "Sum = " << sum << endl;
	cout << "Average = " << float(sum)/size << endl;

	return 0;
}
