public class Cal_count {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = 0;//统计整数的个数
int b = 0;//统计负数的个数
for(;;){
System.out.println("请输入一个整数:");
int x = scanner.nextInt();
if(x>0){
a++;
}else if(x<0){
b++;
}else{
break;
}
System.out.println("整数的个数为:"+a);
System.out.println("负数的个数为:"+b);
}
}
}