Hdu-2008

杭电OJ-2008

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2008

#include<stdio.h>

int main()

{

         int n,a,b,c;

         float num;///////////////////////此处数据定义为浮点型足以

         while(scanf("%d",&n)!=EOF&&n)

         {

                   a=0;

                   b=0;

                   c=0;

                   while(n--)

                   {

                            scanf("%f",&num);

                            if(num<0)

                                     a++;

                            if(num==0)

                                     b++;

                            if(num>0)

                                     c++;

                   }

                   printf("%d %d %d\n",a,b,c);

         }

         return 0;

}

posted @ 2018-04-28 17:16  里昂静  阅读(90)  评论(0编辑  收藏  举报