📜  如何在java代码示例中不允许用户输入大于100或小于0的标记

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

代码示例1
int[] cw_Mark = new int[6];
    for (int i = 0; i < cw_Mark.length; i++) {
        if (i >= 0 || i <= 100) {
            System.out.println("Please Enter Your Module " + (i+1) + " Coursework Mark: ");
            cw_Mark[i] = input.nextInt();
        } else {
            System.out.println("Please Enter a Number Between 1 and 100");
        }
    }