package com.imooc;
import java.util.*;
/*定義字符串?dāng)?shù)組保存圖書信息
*提示用戶分別按 書名和圖書序號查找圖書
*
*/
public class Book {
public static void main(String[] args) {
boolean x;
String[] book=new String[3];
book[0]="英語";
book[1]="論語";
book[2]="高數(shù)";
System.out.print("輸入命令方式:1——按照書名查找圖書; 2——按照書序號查找圖書 ");
Scanner input=new Scanner(System.in);
int fangshi=input.nextInt();
if(fangshi==1){
System.out.println("---書名查找圖書---");
}else if(fangshi==2){
System.out.println("——圖書序號查找圖書——");
}
Scanner incan=new Scanner(System.in);
int xuhao=incan.nextInt();
String name=incan.nextLine();
try{
}catch(InputMismatchException i ){
System.out.println("命令輸入錯(cuò)誤!請根據(jù)提示輸入數(shù)字命令");
}

MissYouEven
2014-08-03
1 回答
舉報(bào)
0/150
提交
取消
2014-08-04
額,你的問題是啥涅