import java.util.Scanner; /** * Created by feyman1120 on 2017/11/23. */ public class Main { public static void main(String [] args){ Scanner scan = new Scanner(System.in); while (scan.hasNext()){ int m = scan.nextInt(); if (0 == m){ break; } int sumNegative = 0; int sumPostive = 0; int sumZeros = 0; for (int i = 0; i < m; ++i){ double x = scan.nextDouble(); if (x < 0){ sumNegative++; } else if (x > 0){ sumPostive++; } else { sumZeros++; } } System.out.println(sumNegative + " " + sumZeros + " " + sumPostive); } } }
hdu_2008 数值统计
最新推荐文章于 2020-04-09 00:57:40 发布