}
}
if(p!=
cout<<
cin>>a;
cout<<
cin>>b;
cout<<
cin>>c;
flag=
if((a>banker
cout<< flag=0; } if((b>banker.remain_b)||(b>processes[p].need_b-processes[p].b)){ cout<<"錯誤,所申請B類資源大於銀行家所剩B類資源或該進程還需數量"< flag=0; } if((c>banker.remain_c)||(c>processes[p].need_c-processes[p].c)){ cout<<"錯誤,所申請C類資源大於銀行家所剩C類資源或該進程還需數量"< flag=0; } if(flag){ banker.remain_a-=a; banker.remain_b-=b; banker.remain_c-=c; [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
From:http://tw.wingwit.com/Article/program/czxt/201311/24032.html