如何實現,輸入錯誤請重新輸入,將語句跳轉到Scanner in=new Scanner(System.in);這一行呢?或者說我的著種寫法本身就是錯的??System.out.println("請輸入一個星期數");
?????Scanner?in=new?Scanner(System.in);
?????int?x=in.nextInt();
?????if((x<1||x>7)){
?????System.out.println("輸入錯誤請重新輸入");
??????/*(此處應有代碼..)*/
?????}
添加回答
舉報
0/150
提交
取消