import java.util.Scanner;
class FooBizBaz{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int a = 0;
int b = 0;
for(int num = 1;num == 0;){
System.out.println("请输入一个书");
num = s.nextInt();
if(num>0)
a++;
if(num<0)
b++;
}
System.out.println("正数个数为" + a);
import java.util.Scanner; class FooBizBaz{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int a = 0; int b = 0; for(int num = 1;num != 0;){ System.out.println("请输入一个书"); num = s.nextInt(); if(num>0) a++; if(num<0) b++; } System.out.println("正数个数为" + a); System.out.println("负数个数为" + b); } }