#define _CRT_SECURE_NO_WARNINGS
#include<stdlib.h>
#include <iostream>
using namespace std;
struct allocation {
int value;
allocation *next;
};
struct max {
int value;
max *next;
};
struct available {
int value;
available *next;
};
struct need {
int value;
need *next;
};
struct path {
int value;
path *next;
};
struct finish {
int stat;
finish *next;
};
int main() {
int row, colum, status = 0, i, j, k, l, t, temp, processtest;
allocation *allochead = new allocation;
allocation *allocation1 = allochead;
max *maxhead = new max;
max *max1 = maxhead;
available *avahead = new available;
available *available1 = avahead;
available *workhead = new available;
available *work1 = workhead;
need *needhead = new need;
need *need1 = needhead;
finish *finihead = new finish;
finish *finish1 = finihead;
path *pathhead = new path;
path *path1 = pathhead;
printf("请输入系统资源的种类数:");
scanf("%d", &colum);
printf("请输入现在内存中的进程数:");
scanf("%d", &row);
printf("请输入已分配资源矩阵:\n");
for (i = 0; i < row; i++)
{
for (j = 0; j < colum; j++)
{
<
结构体指针实现的银行家算法C++版
最新推荐文章于 2024-05-01 13:02:22 发布