#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx

上传人:b****2 文档编号:13709421 上传时间:2022-10-13 格式:DOCX 页数:17 大小:42.95KB
下载 相关 举报
#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx_第1页
第1页 / 共17页
#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx_第2页
第2页 / 共17页
#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx_第3页
第3页 / 共17页
#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx_第4页
第4页 / 共17页
#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx_第5页
第5页 / 共17页
点击查看更多>>
下载资源
资源描述

#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx

《#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx(17页珍藏版)》请在冰豆网上搜索。

#操作系统课程设计银行家算法流程图 源代码 设计报告Word格式文档下载.docx

/*

四、程序流程图:

#include 

"

string.h"

stdio.h"

#include"

dos.h"

conio.h"

#defineMOVEIN1

#defineGUIYUE2

#defineACC3

#defineOK1

#defineERROR0

#defineMAXSH7

#defineMAXSHL10

#defineMAXINPUT50

#define 

maxsize 

100

intact;

intip=0;

int 

line=0;

 

/*line为要写的行号,全局变量*/

intwriteok;

intright;

charwel[30]={"

WelcomeToUseAn_LiSystem"

};

charente[76]={"

警告:

未经作者同意不得随意复制更改!

charrights[40]={"

Copyright(c)2002"

structdatetoday;

structtimenow;

typedefstruct

{intdata[maxsize];

 

inttop;

}stack;

intemptystack(stack*S)

{if(S->

top==48&

&

S->

data[S->

top]==35)return

(1);

/*35is'

#'

*/

elsereturn(0);

}

intpush(stack*S,intx)

top>

=maxsize-1)return(-1);

else{S->

top++;

top]=x;

return(0);

}

intgettop(stack*S)

{returnS->

top];

intpop(stack*S)

{if(emptystack(S)){

printf("

thestackisempty\n"

);

exit

(1);

elseS->

top--;

returnS->

top+1];

voidinitstack(stack*S)

{inti;

top=0;

top]=35;

/*****模拟打字机的效果*********/

delay_fun()

{

inti;

voidmusic();

for(i=0;

;

i++)

if(wel!

='

\0'

{

delay(1000);

textcolor(YELLOW);

gotoxy(26+i,8);

cprintf("

%c"

wel);

谢谢"

网络"

music(1,60);

elsebreak;

delay(500000);

;

i++)

if(ente!

textcolor(RED);

/*显示警告及版权*/

gotoxy(2+i,11);

ente);

delay(40000);

if(rights!

='

gotoxy(30+i,14);

rights);

music(1,60);

else

break;

getch();

/*********登陆后的效果**********/

logined()

clrscr();

gotoxy(28,10);

textcolor(YELLOW);

cprintf("

程序正在载入 

请稍候....."

gotoxy(35,12);

i<

=50;

gotoxy(40,12);

delay(8000);

%02d%已完成"

i*2);

gotoxy(i+15,13);

\n"

|"

main0();

/*********对PC扬声器操作的函数****/

voidmusic(intloop,intf) 

/*f为频率*/

30*loop;

sound(f*20);

delay(200);

nosound();

intanalys(ints,inta)

{inthh,pos;

switch(a)

{case(int)'

i'

hh=0;

break;

case(int)'

+'

hh=1;

*'

hh=2;

('

hh=3;

)'

hh=4;

hh=5;

E'

hh=6;

T'

hh=7;

F'

hh=8;

default:

{printf("

\nanalys()分析发现不该有的字符%c!

(位置:

%d)"

a,ip+1);

writeerror('

0'

"

\n............分析出现错误!

!

writeerror(a,"

\n错误类型:

不该有字符"

网"

returnERROR;

pos=(s-48)*10+hh;

switch(pos)

{case3:

case43:

case63:

case73:

act=4;

returnMOVEIN;

case0:

case40:

case60:

case70:

act=5;

case11:

case81:

act=6;

case92:

case22:

act=7;

case84:

act=11;

/*-------------------------------------------*/

case91:

case94:

case95:

act=1;

returnGUIYUE;

case21:

case24:

case25:

act=2;

case101:

case102:

case104:

case105:

act=3;

case31:

case32:

case34:

case35:

case111:

case112:

case114:

case115:

case51:

case52:

case54:

case55:

act=6;

/*+++++++++++++++++*/

case15:

returnACC;

/*******************************/

case6:

return1;

case7:

case47:

return2;

case8:

case48:

case68:

return3;

case46:

return8;

case67:

return9;

case78:

return10;

{if(a=='

)printf("

elseprintf("

\nanalys()分析发现字符%c不是所期望的!

writeerror('

\n...........分析出现错误!

writeerror(a,"

字符"

不是所期望的!

"

intwritefile(inta,char*st)

{FILE*fp;

fp=fopen("

an_slr.txt"

a"

if(fp==0){printf("

\nwriteerror!

writeok=0;

else{if

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 其它模板

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1