「聊斋java」聊斋剑仙

博主:adminadmin 2023-03-20 13:34:08 408

今天给各位分享聊斋java的知识,其中也会对聊斋剑仙进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

哪一位编程大师帮我用java写一份图书馆管理系统,

运行一下看要不要咯。

package booksborrow;

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

class Student{

String number;

String name;

String[] booksName=new String[4];

int booksNum;

public Student(String number,String name,String booksName,int booksNum){

this.number=number;

this.name=name;

this.booksNum=booksNum;

for(int i=0;i4;i++) {

this.booksName[i]=new String("");

}

}

}

class Books{

static String bname[]={"红楼梦","西游记","三国演义","水浒传","聊斋志异",

"java编程经典","数字电子技术","老人与海","电子商务","子夜","中国十大皇帝",

"邓小平文选","鲁迅散文全集","空蝉","商法","刑法","民法","数据库导论",

"管理信息系统","财务管理","统计学","线性代数","离散数学","逻辑学",

"高等代数"};

static String biden[]=new String[bname.length+1];

static int[] bnum=new int[bname.length+1];

public Books(){

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

bnum[i]=7;

switch(i/10){

case 0:biden[i]="112200"+i;break;

case 1:

case 2:

case 3:biden[i]="11220"+i;break;

}

}

}

boolean count(String books_identifier,int borr_or_retur){

final int borr=0;

final int retur=1;

int i;

for(i=0;biden[i]!=null;i++) {

if(biden[i].equals(books_identifier)) {

break;

}

}

if(biden[i]==null){

System.out.println("\t\t**********无此书!**********");

return false;

}

else if(borr_or_retur==borr) {

if(bnum[i]==0){

System.out.println("\t\t*****此书已全部被借走!*****");

return false;

}

else {

bnum[i]--;

}

}

else {

bnum[i]++;

}

return true;

}

}

class Borrow{

public void borrow(String number,String name,String booksName,String books_identifier,Student[] stu,Books book){

int i,j;

boolean judge=false;

for(i=0;!"".equals(stu[i].number) || stu[i].number.equals("-1");i++) {

if(stu[i].number.equals(number) || stu[i].name.equals(name)){judge=true;break;}

}

if(stu[i].booksNum=4) {

System.out.println("\t对不起,您所借的图书已达到上限,请还书后再继续借书!");

}

else if(book.count(books_identifier,0)) {

if(judge==false) {

stu[i].number=number;

stu[i].name=name;

stu[i].booksName[0]=booksName;

stu[i].booksNum=1;

}

else{

for(j=0;!stu[i].booksName[j].equals("") !stu[i].booksName[j].equals("-1");j++);

stu[i].booksName[j]=booksName;

stu[i].booksNum++;

}

}

}

}

class Return{

public void retur(String number,String name,String booksName,String books_identifier,Student[] stu,Books book){

int i,j;

for(i=0;!"".equals(stu[i].name) || stu[i].name.equals("-1");i++) {

if(stu[i].name.equals(name)) {

break;

}

}

if("".equals(stu[i].name)) {

System.out.println("\t\t**请核实: 您之前并未借书!**");

}

else if(book.count(books_identifier,1)){

for(j=0;!stu[i].booksName[j].equals("") || stu[i].booksName[j].equals("-1");j++) {

if(stu[i].booksName[j].equals(booksName)){

stu[i].booksName[j]="-1";

break;

}

}

stu[i].booksNum--;

if(stu[i].booksNum==0){

stu[i].number="-1";

stu[i].name="-1";

}

}

}

}

class BooksBorrow{

public static void main(String[] args){

Student[] stu=new Student[100000];

String number;

String name;

String booksName;

String books_identifier;

int going=0;

int conti;

int title=0;

Books book=new Books();

Borrow bo=new Borrow();

Return re=new Return();

for(int i=0;i100000;i++) {

stu[i]=new Student("","","",0);

}

do{

System.out.print("\t\t请从以下菜单中选择操作:\n\t\t\t1---------查询图书馆藏"

+ "书概况\n\t\t\t2---------借书\n\t\t\t3---------还书\n\t\t请输入:");

try{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

title=Integer.parseInt(br.readLine());

}catch(IOException | NumberFormatException e){}

if(title==1){

System.out.println("图书馆藏书概况如下:\n编号\t\t 书名\t\t 可借阅本数");

try{for(int i=0;Books.bname[i]!=null;i++) {

System.out.println(Books.biden[i]+"\t\t"+Books.bname[i]+"\t\t"+Books.bnum[i]);

}

}catch(ArrayIndexOutOfBoundsException e){}

}

else if(title==2) {

try{System.out.print("t********************借书*******************\n\t\t请输入学号:");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

number=br.readLine();

System.out.print("\t\t请输入姓名:");

name=br.readLine();

do

{System.out.print("\t\t请输入书号:");

books_identifier=br.readLine();

System.out.print("\t\t请输入书名:");

booksName=br.readLine();

bo.borrow(number,name,booksName,books_identifier,stu,book);

System.out.print("\t\t是否继续(1--Y/0--N请输入1或0): ");

conti=Integer.parseInt(br.readLine());

}while(conti==1);

}catch(IOException | NumberFormatException e){System.err.println(e);}

}

else if(title==3) {

try{System.out.print("\t********************还书********************\n\t\t请输入学号:");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

number=br.readLine();

System.out.print("\t\t请输入姓名:");

name=br.readLine();

do

{System.out.print("\t\t请输入书号:");

books_identifier=br.readLine();

System.out.print("\t\t请输入书名:");

booksName=br.readLine();

re.retur(number,name,booksName,books_identifier,stu,book);

System.out.print("\t\t是否继续(1--Y/0--N请输入1或0): ");

conti=Integer.parseInt(br.readLine());

}while(conti==1);

}catch(IOException | NumberFormatException e){System.err.println(e);}

}

else {

System.out.println("\t\t*********输入错误*********!");

}

try{System.out.print("是否退出(1--Y/0--N请输入1或0):");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

going=Integer.parseInt(br.readLine());

}catch(IOException | NumberFormatException e){}

}while(going==0);

}

}

java 为什么else总是报错啊 求大神 速急

if(条件){

//code

}else{

//code

}

建议这种写法,方便观看

java游戏大话聊斋诛鬼情缘安卓手机怎么安装?

先下载一个(mrp虚拟机)也就是模拟器,下载后安装打开mrp软件,在软件里打开你下载好的java游戏就可以了。

求经典java 手机游戏10个

推荐几款我认为不错的免费手机游戏,都测试过可以用:

聊斋之七情六欲破解版(RPG)

彩虹城堡之七彩宝石篇(RPG)

真三国无双之赵云传破解版(动作)

正版雷电3豪华版(射击)

四人麻将单机版(棋牌)

皮皮猪斗地主(棋牌)

3D疯狂过山车(超级有趣的)

疯狂龙卷风汉化版(趣味)

三国志吞食天地(动作)

刀剑风云斩II-至尊格斗(动作)

漆黑惊栗(恐怖)

火焰之纹章2纹章之谜破解版(策略)

超级玛利奥兄弟(经典)

求个能玩的单机java游戏聊斋2妖魔道

MHOL系列完全舍弃了一路上不得不打的各种杂兵小怪,对所有玩家采用了开放式的地图设计,允许玩家完全不打小怪,直面巨型BOSS。由于跳过了沉闷的清杂兵环节,让每一场战斗都变得极其刺激紧张,玩家只需考虑清楚自己的战术、运用熟练手上的武器,通过团队配合打败大型怪物即可获得胜利,这也是区别其他游戏的最大特色之一。

关于聊斋java和聊斋剑仙的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。