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

  • 大小: 0.01M
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-08
  • 語言: C/C++
  • 標簽: 其他??

資源簡介

bank.cpp

資源截圖

代碼片段和文件信息

/*
??Name:?銀行排隊取號系統模擬
??Copyright:?
??Author:?***
??Date:?13/04/09?12:45
??Description:?
*/



#include?
#include?

//-----------------各個窗口業務隊列?---------------

//typedef?int?Elem;

typedef?struct?qNode{
????????int?val;
????????qNode*?next;
}qNode?*qPoint;?

typedef?struct?{
????????int?length;
????????qPoint?front;
????????qPoint?rear;
}Bankqueue;

void?initQueue(Bankqueue&?b){
?????b.front?=?b.rear?=?(qPoint)malloc(sizeof(qNode));
?????if(!b.front)exit(0);
?????b.front->next?=?NULL;
?????b.length?=?0;
}

void?destryQueue(Bankqueue&?ql){
?????while?(ql.front){
???????????ql.rear?=?ql.front->next;
???????????free(ql.front);
???????????ql.front?=?ql.rear;
?????}
}

void?push(Bankqueue&?b?int?e){
?????qPoint?p;
?????p?=?(qPoint)malloc(sizeof(qNode));
?????if(!p)exit(0);
?????p->val?=?e;
?????b.rear->next?=?p;
?????b.rear?=?p;
?????b.length++;
}

void?pop(Bankqueue&?b){
//?????if(b.front->next){
????????????if?(b.front?!=?b.rear){
?????????????????qPoint?t;
?????????????????t?=?b.front->next;
?????????????????if?(b.rear?==?t){
????????????????????????????b.rear?=?b.front;
????????????????????????????b.front->next?=NULL;
?????????????????}else{
???????????????????????b.front->next?=?t->next;
?????????????????}
?????????????????
?????????????????free(t);
?????????????????b.length--;
????????????}
//????}
}

int?front(Bankqueue?b){
?????if?(b.front?!=?b.rear){
?????????????????return?b.front->next->val;
?????}
}

bool?empty(Bankqueue?b){
?????return?b.length?==?0;
}?

//-------------------銀行卡窗口間隊列?--------------------


//typedef?struct?bNode{
//????????Bankqueue?val;
//????????bNode*?next;
//}bNode?*bPoint;?

//typedef?struct?{
//????????int?length;
//????????bPoint?front;
//????????bPoint?rear;
//}Operationqueue;

//void?initOpQueue(Operationqueue&?b){
//?????b.front?=?b.rear?=?(bPoint)malloc(sizeof(bNode));
?//????if(!b.front)exit(0);
//?????b.front->next?=?NULL;
//?????b.length?=?0;
//}

//void?pushb(Operationqueue&?b?Bankqueue?e){
?//????bPoint?p;
?//????p?=?(bPoint)malloc(sizeof(bNode));
?//????if(!p)exit(0);
?//????p->val?=?e;
//?????b.rear->next?=?p;
//?????b.rear?=?p;
//?????b.length++;
//}

//Bankqueue?frontb(Operationqueue?b){
//?????if?(b.front?!=?b.rear){
//?????????????????return?b.front->val;
?//????}
//}

//void?popb(Operationqueue&?b){
//?????if(!b.front){
//????????????if?(b.front?!=?b.rear){
//?????????????????bPoint?t;
//?????????????????t?=?b.front->next;
//?????????????????if?(b.rear?==?t){
?//???????????????????????????b.rear?=?b.front;
//?????????????????}
//????????????}
//?????}
//}

//------------------各業務選項方法---------------?
//void?operationOne(Bankqueue&??int);????//公積金隊列?
//void?operationTwo(Bankqueue&?Bankqueue&??int?int?[]);?//銀行卡隊列、銀行卡窗口隊列、當前客戶取號、銀行卡窗口數組?
//void?operationThree(Bankqueue&?a?Bankqueue&?b?int?i?int?B[]);?//理財卡隊列、銀行卡隊列、當前取得理財卡排除號、銀行卡窗口數組?
//----

評論

共有 條評論