• 大小: 12KB
    文件类型: .cpp
    金币: 1
    下载: 0 次
    发布日期: 2021-01-01
  • 语言: C/C++
  • 标签:

资源简介

采用 读取 文件的形式编写的~~~通过读入文件中的数据来实现银行家的算法~~ 忘记传读取文件了,在我的资源里面有,下完这个去我的资源里找一下"银行家算法的文件格式"就行了

资源截图

代码片段和文件信息

#include 
#include 
#include 
using namespace std;
#define null 0
struct bankers
{
    char name[10];
int resource[10];
int allocation[10];
int need[10];
int type;
}process[100];
struct bankers_copy1
{
    char name_copy1[10];
int resource_copy1[10];
int allocation_copy1[10];
int need_copy1[10];
int type_copy1;
}process_copy1[100];//恢复数据用
struct bankers_copy
{
    char name_copy[10];
int resource_copy[10];
int allocation_copy[10];
int need_copy[10];
int work[10];
}process_copy[100];//存序列
int process_numberresource_number;
int max[10]={1057};
int max_now[10]={1057};//存当前资源
int max_now1[10];
int max_now2[10];
int number[10];
int middle[10];
void init()
{
int total=0;
while(total {
sc

评论

共有 条评论