1、銀行家算法的代碼(c語言)
2、#include
3、#include
4、#include
5、# define m 50
6、# define true 1
7、# define false 0
8、int no1: //進程數
9、int no2: //資源數
10、int r:
11、int allocation[m][m],need[m][m],available[m],max[m][m]:
12、char name1[m],name2[m]: //定義全局變量
13、void main()
14、{
15、void check():
16、void print(): //提前聲明
17、int i,j,p=0,q=0:
18、char c:
19、int request[m],allocation1[m][m],need1[m][m],available1[m]:
20、printf("**********************************************n"):
21、printf("* 銀行家算法的設計與實現 *n"):
22、printf("**********************************************n"):