杭电OJ 2008

来源:互联网 发布:mac无损播放器 编辑:程序博客网 时间:2024/06/06 08:28

2016-11-13

#include<stdio.h>int main(void){    int i,n;    int negative,zero,positive;    float a[100];    while(scanf("%d",&n) ==1  && n)    {        negative=0,zero=0,positive=0;        for(i=0; i<n; i++)        {            scanf("%f",&a[i]);        }        for(i=0; i<n; i++)        {            if(a[i]<0)                negative++;            if(a[i]==0)                zero++;            if(a[i]>0)                positive++;        }        printf("%d %d %d\n",negative,zero,positive);    }    return 0;}
0 0
原创粉丝点击