第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

交作業(yè)(圖書查詢系統(tǒng))

package com.imooc.books;


import java.util.Scanner;


public class books {


public static void main(String[] args){

String[] books = {

"高數(shù)","語文","英語","政治"

};

Scanner input = new Scanner(System.in);

System.out.println("******圖書查詢系統(tǒng)******");

while(true){

try{

System.out.println("輸入命令:1-按照名查找圖書;2-按照序號查找圖書;3-退出");

int x = input.nextInt();

if(x == 1){

String bookName = input.next();

for(int i = 0;i < books.length;i++){

if(bookName.equals(books[i])){

System.out.println("book:" + books[i]);

break;

}

if(i == books.length-1)

System.out.println("您查找的圖書不存在,請重新輸入");

}

}

else if(x == 2){

int number = input.nextInt();

if(number <= books.length){

System.out.println("book:" + books[number-1]);

}

else{

System.out.println("您查找的圖書不存在,請重新輸入");

}

}

else if(x == 3){

System.out.println("Bye!");

break;

}

else{

System.out.println("輸入有誤請根據(jù)提示輸入數(shù)字");

}

}catch(Exception e){

System.out.println("命令輸入錯誤!");

input.nextLine();

continue;

}

}

}


}


正在回答

2 回答

好像沒有異常拋出把?

0 回復(fù) 有任何疑惑可以回復(fù)我~

666

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

交作業(yè)(圖書查詢系統(tǒng))

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號