/*
Write a program to read a set of integers from the keyboard and to average 
them. Let -999 mark the end of the data.
*/
#include <iostream>
using namespace std;
int main()
{
	int N,num, count = 0;
	float avg, sum = 0;

	cout << "Enter an integer and -999 to stop: ";
	cin >> num;
	while (num != -999)
	{
		count++;
		sum = sum + num;
		cout << "Enter an integer and -999 to stop: ";
		cin >> num;
	}
	if (count != 0)
	{
		avg = sum / count;
		cout << "Average = " << avg << endl;
	}
	else
		cout << "No numbers entered.\n";
	return 0;
}
