public class Print{
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
for(int i = 0; i <4 ;) {
System.out.print("请输入1或者2:");
int a=input.nextInt();
i++;
if (a>2){
System.out.println("您的输入有误,请重新输入!");
}else{
i++;
}
}
}
}
public class Test02 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
for (int i = 0; i <4 ; i++) {
int a=input.nextInt();
if (a>2){
System.out.println("您的输入有误,请重新输入");
i--;
}
}
}
}