import java.util.*;
public class booktest{
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] bname={"高等数学","计算机","口语","Java","c++"};
System.out.println("请输入书名或图书序号!");
System.out.println("请选择 1书名 0 序号");
Scanner s=new Scanner(System.in);
w:for(;;){
int a=s.nextInt();
if(a==1)
{
System.out.println("请输入书名:");
String a1=s.next();
for(String b:bname)
{if(b.equals(a1))
{System.out.println("存在");
continue w;}}
//else
System.out.println("不存在");
}else if(a==0)
{
System.out.println("请输入序号:");
try {
int a2=s.nextInt();
if(a2>=0 && a2<bname.length){
for(String b:bname)
{System.out.println(bname[a2-1]);
continue w;
}}
else
System.out.println("图书不存在!");
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
System.out.println("输入错误,请重新输入!");
}
finally
{System.out.println("欢迎您下次光临");}
}
}
}
}
请问你需要问什么问题呀