标签:images closed color sum void put enter style hid
1 public class Demo { 2 public static void main(String[] args) { 3 java.util.Scanner input = new java.util.Scanner(System.in); 4 int num = input.nextInt(); 5 int count=0; 6 int a=0,b=0; 7 float sum=0; 8 while(num!=0){ 9 if(num>0) 10 a++; 11 else 12 b++; 13 sum+=num; 14 num=input.nextInt(); 15 count++; 16 } 17 if(count!=0) 18 System.out.println(a+","+b+","+sum+","+sum/count); 19 else 20 System.out.println("No numbers are entered except 0"); 21 } 22 }
标签:images closed color sum void put enter style hid
原文地址:http://www.cnblogs.com/lirun/p/5988959.html