http://acm.hdu.edu.cn/showproblem.php?pid=2008

 2008 数值统计 随笔

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
#pragma warning(disable:4996) 
#include<stdio.h>
int main() {
    int n;
    double num;
    int a, b, c;

    while (scanf("%d ", &n),n )
    {
        a = b = c = 0;
        for (int i = 0; i < n; i++)
        {
            scanf("%lf", &num);
            if (num < 0)
                a++;
            else if (num > 0)
                c++;
            else
                b++;
        }
        printf("%d %d %d\n", a ,b,c);
    }
    return 0;
}

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄