/*
This program asks the user to enter a positive integer 
n and then it reads n real number and prints the average
of the positive numbers read and the average of the 
negative numbers read.
*/
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int n, countN = 0, countP = 0;
	float x, sumN = 0, sumP = 0;
	cout << "Enter a positive integer: ";
	cin >> n;
	if (n > 0)
	{
	for (int i = 1; i <= n; i++)
	{
		cout << "Enter a real number: ";
		cin >> x;
		if (x > 0)
		{
			sumP += x;
			countP++;
		}
		else if (x < 0)
		{
			sumN += x;
			countN++;
		}
	}
	if (countN == 0)
		cout << "No negative numbers were entered.\n";
	else
		cout << sumN/countN << endl;
	if (countP == 0)
		cout << "No negative numbers were entered.\n";
	else
		cout << sumP/countP << endl;
	}
	else
		cout << "You have to enter a positive int\n";
	return 0;
}

