HDOJ 2008 数值统计

// HDOJ 2008 数值统计
// @author:	bos
// @date:	2012.2.16
#include <stdio.h>
int main()
{
	int n;
	double a[100];
	int count1;
	int count2;
	int count3;
	while((scanf("%d", &n)!= EOF)&& n!= 0)
	{
		int i;
		count1= 0;
		count2= 0; 
		count3= 0;
		for (i= 0; i< n; i++)
		{
			
			scanf("%lf", &a[i]);
			if(a[i]< 0) count1++;
			else if(a[i]== 0) count2++;
			else count3++;
		}
		printf("%d %d %d\n", count1, count2, count3);

	}
	return 0;
}
posted @ 2012-02-16 00:38  ibos  阅读(160)  评论(0编辑  收藏  举报