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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

發(fā)一下我的答案

public class ChaShu {

public static void main(String[] args) {

ChaShu cs = new ChaShu();

cs.FindBook();

}

public void FindBook() {

while(true) {

System.out.println("輸入命令:1-按照名稱查找圖書;2-按照序號(hào)查找圖書");

Scanner sc = new Scanner(System.in);

try {

int i =sc.nextInt();

if(i==1) {

String bookname = null;

First(bookname );

}

if(i==2) {

int a = 0;

Second(a);

}else{

System.out.println("輸入錯(cuò)誤,請(qǐng)重新輸入");

}

}catch(Exception e) {

System.out.println(e.getMessage());

}

}

}

public void First(String bookname) {

System.out.println("請(qǐng)輸入圖書名稱:");

String book[] = {"高數(shù)","英語(yǔ)","語(yǔ)文"};

Scanner sc = new Scanner(System.in);

bookname = sc.nextLine();

try {

int a=1000000;

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

if(bookname.equals(book[i])) {

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

a=-1;

}

}

if(a==1000000) {

throw new Exception();

}

}catch(Exception e) {

System.out.println("圖書不存在");

}

}

public void Second(int a) {

System.out.println("請(qǐng)輸入圖書id");

Scanner sc = new Scanner(System.in);

String book[] = {"高數(shù)","英語(yǔ)","語(yǔ)文"};

a = sc.nextInt();

if(a>0 && a<=book.length) {

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

}else {

System.out.println("圖書不存在");

}

}

}


正在回答

1 回答

牛批!

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

舉報(bào)

0/150
提交
取消

發(fā)一下我的答案

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

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

幫助反饋 APP下載

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

公眾號(hào)

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