欢迎来到天天文库
浏览记录
ID:6802172
大小:740.50 KB
页数:33页
时间:2018-01-26
《轻量级工作流系统全部代码及设计报告》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include#include#include#includeusingnamespacestd;constintmax=21;//最多节点数;#definev_typechar//节点类型;typedefinta_type;//边类型;typedefstructmatrix{v_typevertex[max+2][31];a_typearc[max][max];intindegree[max],outdegree[max
2、];intv_number,a_number;}matrix;//邻接矩阵;typedefstructQueue{v_typeelem[max][31];inttop,tail;}Queue;//队列;voidInitQueue(Queue&Q){Q.top=0;Q.tail=0;return;}boolEmptyQueue(QueueQ){if(Q.top==Q.tail)returntrue;returnfalse;}voidOutQueue(Queue&Q,v_type*ch){strcpy(
3、ch,Q.elem[Q.top]);Q.top=(Q.top+1)%max;}voidEnQueue(Queue&Q,v_type*ch){strcpy(Q.elem[Q.tail],ch);Q.tail=(Q.tail+1)%max;}voidInitMatrix(matrix&M,char(*value)[20]){intt=0;while(value[t][0]!=' '){strcpy(M.vertex[t],value[t]);t++;}M.v_number=t;inti,j;for(i
4、=0;i5、utdegree[0]++;M.indegree[3]++;M.arc[0][4]=30;M.outdegree[0]++;M.indegree[4]++;M.arc[5][6]=0;M.outdegree[5]++;M.indegree[6]++;for(j=1;i<=4;i++){M.arc[i][5]=1;M.outdegree[i]++;M.indegree[5]++;}}voidAll_Node(matrixM){intCOUNT;COUNT=0;QueueQ;InitQueue(Q);i6、ntsign[max];inti=0;while(i7、f(M.v_number!=COUNT){MessageBox(NULL,TEXT("存在有向环!!"),TEXT("Error"),MB_OK);}v_typevalue[31];for(;EmptyQueue(Q)!=true;){OutQueue(Q,value);cout<3){EnQueue(Q,M.vertex[0]);EnQueue(Q8、,M.vertex[3]);EnQueue(Q,M.vertex[5]);EnQueue(Q,M.vertex[6]);}if(T<=0)MessageBox(NULL,TEXT("请假时间有误!!"),TEXT("Error"),MB_OK);if(T<=3&&T>1){EnQueue(Q,M.vertex[0]);EnQueue(Q,M.vertex[2]);EnQueue(Q,M.vertex[5]);EnQueue(Q,M.vertex[6]);}if(T==
5、utdegree[0]++;M.indegree[3]++;M.arc[0][4]=30;M.outdegree[0]++;M.indegree[4]++;M.arc[5][6]=0;M.outdegree[5]++;M.indegree[6]++;for(j=1;i<=4;i++){M.arc[i][5]=1;M.outdegree[i]++;M.indegree[5]++;}}voidAll_Node(matrixM){intCOUNT;COUNT=0;QueueQ;InitQueue(Q);i
6、ntsign[max];inti=0;while(i7、f(M.v_number!=COUNT){MessageBox(NULL,TEXT("存在有向环!!"),TEXT("Error"),MB_OK);}v_typevalue[31];for(;EmptyQueue(Q)!=true;){OutQueue(Q,value);cout<3){EnQueue(Q,M.vertex[0]);EnQueue(Q8、,M.vertex[3]);EnQueue(Q,M.vertex[5]);EnQueue(Q,M.vertex[6]);}if(T<=0)MessageBox(NULL,TEXT("请假时间有误!!"),TEXT("Error"),MB_OK);if(T<=3&&T>1){EnQueue(Q,M.vertex[0]);EnQueue(Q,M.vertex[2]);EnQueue(Q,M.vertex[5]);EnQueue(Q,M.vertex[6]);}if(T==
7、f(M.v_number!=COUNT){MessageBox(NULL,TEXT("存在有向环!!"),TEXT("Error"),MB_OK);}v_typevalue[31];for(;EmptyQueue(Q)!=true;){OutQueue(Q,value);cout<3){EnQueue(Q,M.vertex[0]);EnQueue(Q
8、,M.vertex[3]);EnQueue(Q,M.vertex[5]);EnQueue(Q,M.vertex[6]);}if(T<=0)MessageBox(NULL,TEXT("请假时间有误!!"),TEXT("Error"),MB_OK);if(T<=3&&T>1){EnQueue(Q,M.vertex[0]);EnQueue(Q,M.vertex[2]);EnQueue(Q,M.vertex[5]);EnQueue(Q,M.vertex[6]);}if(T==
此文档下载收益归作者所有