nue;Р }Р?}Р?Р?Р}Рvoid print()Р{Р?int i,j;Р?printf(" 资源 Work Need\tAllocation\tWork+Allocation\t Finish\n\n");Р?printf(" 进程名 A B C A B C \t A B C \t A B C\n");Р?printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");Р?for(i=0; i<N; i++)Р?{Р printf(" %c ",processname[sequence[i]]);Р for(j=0; j<M; j++)Р {Р printf("%d ",Work[sequence[i]][j]);Р }Р printf(" ");Р for(j=0; j<M; j++)Р {Р printf("%d ",Need[sequence[i]][j]);Р }Р printf(" ");Р for(j=0; j<M; j++)Р {Р printf("%d ",Allocation[sequence[i]][j]);Р }Р printf(" ");Р for(j=0; j<M; j++)Р {Р printf("%d ",Work_Allocation[sequence[i]][j]);Р }Р printf(" ");Р printf("%d",Finish[i]);Р printf("\n\n");Р?}Р}Рint check_distribution(int* p,int k)Р{Р?int i=0;Р?int safe1=0,safe2=0;Р?for(i=0; i<M; i++)Р?{Р if(p[i] <= Need[k][i])