···
package com20210409;
import java.util.Scanner;
public class demo01 {
public static void main(String[] args) {
int fanhui =0;
do {
System.out.println("欢迎使用图书馆管理系统");
System.out.println("-------------------------------------");
System.out.println("1.新增图书");
System.out.println("2.查看图书");
System.out.println("3.删除图书");
System.out.println("4.借出图书");
System.out.println("5.归还图书");
System.out.println("6.退出");
System.out.println("-------------------------------------");
System.out.println("请输入你要选择的序号");
Scanner scanner =new Scanner(System.in);
int xzxh = scanner.nextInt();
switch (xzxh) {
case 1:
System.out.println("此处出现新增图书");
break;
case 2:
System.out.println("此处出现要查看的图书");
break;
case 3:
System.out.println("此处出现删除图书");
break;
case 4:
System.out.println("此处出现借出的图书");
break;
case 5:
System.out.println("此处出现要归还的图书");
break;
case 6:
System.out.println("退出成功");
break;
default:
System.out.println("亲输入正确的序号");
break;
}
System.out.println("输入0返回");
int fanhui1 = scanner.nextInt();
fanhui = fanhui + fanhui1;
}while (fanhui ==0 );
}
}
···