}
if(flag){
cout<< } else{ cout<<"本作業所需A類資源:"; cin>>need_a; cout<<"本作業所需B類資源:"; cin>>need_b; cout<<"本作業所需C類資源:"; cin>>need_c; t=1; cout< if(need_a>banker.remain_a){ cout<<"錯誤,所需A類資源大於銀行家所剩A類資源"< t=0; } if(need_b>banker.remain_b){ cout<<"錯誤,所需B類資源大於銀行家所剩B類資源"< t=0; } if(need_c>banker.remain_c){ cout<<"錯誤,所需C類資源大於銀行家所剩C類資源"< t=0; } [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
From:http://tw.wingwit.com/Article/program/czxt/201311/24031.html