freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

銀行家算法操作系統(tǒng)-資料下載頁

2025-07-07 16:16本頁面
  

【正文】 } return 0。}void share()//利用銀行家算法對申請資源對進(jìn)行判定{ char ch。 int i=0,j=0。 ch=39。y39。 printf(\n請輸入要求分配的資源進(jìn)程號從(0 to 4):)。 scanf(%d,amp。i)。//輸入須申請的資源號 printf(請輸入進(jìn)程 %d 申請的資源:\n,i)。 for(j=0。j3。j++) { printf(第 %d 個資源:,j+1)。 scanf(%d,amp。Request[j])。//輸入需要申請的資源 } for (j=0。jN。j++){ if(Request[j]Need[i][j])//判斷申請是否大于需求,若大于則出錯 { printf(進(jìn)程 %d 申請的資源大于它需要的資源,i)。 printf( error!\n)。 ch=39。n39。 break。 } else { if(Request[j]Avaliable[j])//判斷申請是否大于當(dāng)前資源,若大于則 { //出錯 printf(進(jìn)程 %d 申請的資源大于available,i)。 printf( error!\n)。 ch=39。n39。 break。 } } } if(ch==39。y39。) { changdata(i)。//根據(jù)進(jìn)程需求量變換資源 showdata()。//根據(jù)進(jìn)程需求量顯示變換后的資源 chkerr()。//根據(jù)進(jìn)程需求量進(jìn)行銀行家算法判斷 }}void Revision(){ printf(請選擇: 1:修改進(jìn)程還需要的資源 2:修改進(jìn)程可用資源)。 int choice1。 scanf(%d,amp。choice1)。 if(choice1==1){ printf(輸入要修改的資源號(0~4))。 int p。 scanf(%d,amp。p)。 printf(輸入修改后進(jìn)程還需要的資源(1,1,1)\n)。 scanf(%d,%d,%d,amp。Need[p][0],amp。Need[p][1],amp。Need[p][2])。 printf(經(jīng)修改后各進(jìn)程還需求資源:\n)。 for (int a=0。aM。a++){ printf(pr%d:,a)。 for(int b=0。bN。b++) printf(%d, ,Need[a][b])。//輸出還需要資源數(shù) printf(\n)。 } } if(choice1==2) { printf(輸入系統(tǒng)可用資源EX(1,1,1)\n)。 scanf(%d,%d,%d,amp。Avaliable[0],amp。Avaliable[1],amp。Avaliable[2])。 printf(經(jīng)修改后的系統(tǒng)可用資源為\n)。 for (int k=0。kN。k++) printf(%d,Avaliable[k])。 }}int main()//主函數(shù){ printf(****************銀行家算法演示*******************\n)。 printf(**************曾金路amp。amp。雍虎***************\n)。 int choice。 showdata()。//顯示各種資源 chkerr()。//用銀行家算法判定系統(tǒng)是否安全 do{ printf(\n輸入要進(jìn)行的操作 1:分配資源 2: 修改資源 3:離開)。 scanf(%d,amp。choice)。 if(choice==1) { share()。 } if(choice==2) { Revision()。 } if(choice==3) break。 }while((choice==1)||(choice==2))。 return 1。}
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1