求大神指點,在eclipse中輸入數字后沒有反應
System.out.println("歡迎來到答答租車!\n您是否要租車? 1 是 ?0 否");
Scanner input = new Scanner (System.in);
if (input.nextInt() != 1 && input.nextInt() != 0 ){
System.out.println("您的輸入有誤,請重新輸入");
}else if (input.nextInt() == 0){
System.out.println("歡迎下次光臨!");
}else if (input.nextInt() == 1){
System.out.println("您所能租車列表");
System.out.println ("序號" + "\t" + "車名" + "\t" + "載客量" + "\t" + "載貨量" + "\t" + "價格");
for (int i=0; i<cars.length; i++){
cars[i].list();
}
}
2016-10-14
輸入數字 ??
進入for循環結束 ? ? // for循環你什么都沒輸出 ? ?就擺了個式子 ?兄弟
2016-10-12
for循環你想要表達什么??
2016-10-12
代碼有誤