标签:static [] 退出 多少 print stat int else span
1 public static void main(String[] args) { 2 Scanner sc=new Scanner(System.in); 3 System.out.println("请开始输入"); 4 int input=sc.nextInt(); 5 int zhengshu=0; 6 int fushu=0; 7 while(input!=0){ 8 if(input>0){ 9 zhengshu++; 10 }else{ 11 fushu++; 12 } 13 input=sc.nextInt(); 14 } 15 16 System.out.println("正数:"+zhengshu+"个,负数:"+fushu+"个"); 17 }
标签:static [] 退出 多少 print stat int else span
原文地址:http://www.cnblogs.com/halo-chen/p/6907612.html