第1个回答 2020-06-16
class Test{
public static void main(String args[]){
int arr[] = new int[20];
for(int i=0; i<20; i++){
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine()){
arr[i] = sc.nextLine();
}
}
int n = 0;
for(int j=0; j<20; j++){
if(arr[j]>0){
n++;
}
}
System.out.println("正数的个数为:"+n);
}
}本回答被网友采纳