杭电OJ2008

#include <iostream>
using namespace std;
int main()
{
	int x;
	double a[2007];
	while (cin >> x)
	{
		int m = 0, n = 0, t = 0;
		for (int i = 1; i <= x; i++)
		{
			cin >> a[i];
		}
		for (int j = 1; j <= x;j++)
		{
			if (a[j] < 0)
				m++;
		    if (a[j] == 0)
				n++;
		    if (a[j]>0)
				t++;
		}
		cout << m << " " << n << " " << t << endl;
	}
}

猜你喜欢

转载自blog.csdn.net/weixin_42265486/article/details/83583218