大家帮帮忙,输入若干数以0结束该怎么改
输入若干数,以0结束该怎么改??import java.util.Scanner;
public class qqq
{
public static void main(String[] args) {
int[] ch = new int[100];
Scanner s = new Scanner(System.in);
System.out.println("输入若干数,以0结束");
for(int i=0; i<ch.length; i++ ){
if(s.nextInt() != 0){
ch[i] = s.nextInt();
System.out.println(ch[i]);
}
}
}
}