91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-10
  • 語言: C/C++
  • 標簽: c語言??

資源簡介

c語言銀行業務模擬 銀行業務模擬 銀行業務模擬 銀行業務模擬 銀行業務模擬 銀行業務模擬

資源截圖

代碼片段和文件信息

#include
#include
?
????/*隨機數初始值*/
#define?MONEY??200000?????/*個人業務值*/
#define?TRUE??1
#define?FALSE?0
#define?OK???1
#define?ERROR??0
#define?OVERFLOW?-2
#define?CK??1????/*離開事件1:辦理存款*/

typedef?int?status;

typedef?struct{
?int?arrivetime;???/*到達時間*/
?int?OccurTime;???/*事件發生時間*/
?int?NType;??????/*事件類型*/
?int?duration;???/*辦理業務時間*/
?long?int?money;??????/*數額*/
}EventElemType1;

typedef?struct{
?int?arrivetime;
?int?duration;
?long?int?money;
}waitElemType2;???????/*等待隊列元素*/

typedef?struct?QNode1{
ElemType1?data;
struct?QNode1?*next;
}QNode1*Queue1;

typedef?struct?QNode2{
ElemType2?data;
struct?QNode2?*next;
}QNode2*Queue2;

typedef?struct{
?Queue1?front;
?Queue1?rear;
}linkQueue1;

typedef?struct{
?Queue2?front;
?Queue2?rear;
}linkQueue2;


/*全局變量*/
long?int?total_money;
int?total_time;
int?use_time;/*每個顧客所用時間*/
int?money;/*每個顧客辦理的款數*/
int?closetime;/*銀行營業時間*/
int?INTERTIME;?/*下一用戶到達的時間間隔*/
int?DURATION;?/*辦理業務所需時間*/
int?pe_num;???/*辦理業務的次序*/
int?time1;/*系統現在時間*/


linkQueue1?Q1;
linkQueue2?Q2;
Event?en;?????/*事件*/
wait?en1;????/*列表2元素*/

/*初始化隊列1*/
status?InitQueue1()
{Q1.front=Q1.rear=(Queue1)malloc(sizeof(QNode1));
?if(!Q1.front)exit(OVERFLOW);
?Q1.front->next=NULL;
?return?OK;
}

/*初始化隊列2*/

status?InitQueue2()
{Q2.front=Q2.rear=(Queue2)malloc(sizeof(QNode2));
?if(!Q2.front)exit(OVERFLOW);
?Q2.front->next=NULL;
?return?OK;
}

/*銷毀隊列1*/
status?destroyqueue1()
{while(Q1.front)
????{Q1.rear=Q1.front->next;
?????free(Q1.front);
?????Q1.front=Q1.rear;
????}
return?OK;
}

/*銷毀隊列2*/
status?destroyqueue2()
{while(Q2.front)
????{Q2.rear=Q2.front->next;
?????free(Q2.front);
?????Q2.front=Q2.rear;
????}
return?OK;
}

/*隊列1,2?入隊列*/
status?EnQueue1()
{Queue1?prr1;
?p=(Queue1)malloc(sizeof(QNode1));
?if(!p)exit(OVERFLOW);

p->data.arrivetime=en.arrivetime;
p->data.OccurTime=en.OccurTime;
p->data.NType=en.NType;
p->data.duration=en.duration;
p->data.money=en.money;

?r=Q1.front->next;
?while(r)
????{if(p->data.OccurTime?data.OccurTime)??????/*當隊列*/
???????{?if(r==Q1.front->next)
?????????????{p->next=r;
??????????????Q1.front->next=p;
??????????????}
?????????else{r1->next=p;
??????????????p->next=r;
??????????????}

????????}
???????r1=r;r=r->next;
??????}
??if(!r)
????{?if(Q1.front->next==NULL)
?????????{Q1.front->next=p;
??????????Q1.rear=p;
??????????Q1.rear->next=NULL;
??????????}
??????else{
???????p->next=NULL;
???????Q1.rear->next=p;
???????Q1.rear=p;}
????}

return?OK;
}


status?EnQueue2()
{Queue2?p;
?p=(Queue2)malloc(sizeof(QNode2));
?if(!p)exit(OVERFLOW);
?p->data.arrivetime=en1.arrivetime;
?p->data.duration=en1.duration;
?p->data.money=en1.money;
?p->next=NULL;
?Q2.rear->next=p;
?Q2.rear=p;
return?OK;
}

/*隊列1,2?出隊列并用en返回值*/
status?DeQueue1()
{??Queue1?p;
if(Q1.front==Q1.rear)return?ERROR;
?p=Q1.front->next;
?en.arrivetime=p->data.arrivetime;
?en.Oc

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????11498??2008-01-16?23:05??bank.c

-----------?---------??----------?-----??----

????????????????11498????????????????????1


評論

共有 條評論