及正负均值
记负均正II
http://www.nowcoder.com/questionTerminal/64f6f222499c4c94b338e588592b6a62
JAVA
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); float count1 = 0; int count2 = 0; float sum = 0; while (sc.hasNextInt()){ int cur = sc.nextInt(); if (cur >= 0){ count1++; sum += cur; }else{ count2++; } } System.out.println(count2); System.out.printf("%.1f\n", sum/count1); } }