📜  从用户输入中获取 10 个数字 for 循环 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:23.052000             🧑  作者: Mango

代码示例1
import java.util.Scanner;

public class ej1 {
    public static void main(String args[]) {

        int x;

        for (x = 1; x >= 0; ) {
            Scanner input = new Scanner(System.in);
            System.out.print("Type a number: ");
            x = input.nextInt();
        }
    }
}