第1个回答 2015-10-11
import java.util.Scanner;
public class test {
public static void main(String[] args) {
int[] count = new int[3];
int temp;
Scanner s = new Scanner(System.in);
for(int i=0;i<5;i++){
temp=s.nextInt();
if(temp<0){
count[0]++;
}
else if(temp==0){
count[1]++;
}
else if(temp>0){
count[2]++;
}
}
System.out.println("负数:"+count[0]+" 0:"+count[1]+" 正数:"+count[2]);
}
}