一:将键盘输入的数存到数组中,数组长度未知
public class Test{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] num = null;
num = sc.nextLine().split(" ");
int[] number = new int[num.length];
for(int i = 0; i < number.length; i++){
number[i] = Integer.valueOf(num[i]);
}
}
}
每天多一点提高,给自己一些激励,开心生活,用编码来丰富我的生活,加油!
↖(^ω^)↗

浙公网安备 33010602011771号