#include <stdio.h>
#include <cstdlib>
#include <time.h>
#include <string>
#include <windows.h>
#include <iostream>
using namespace std;
typedef struct Node {//创建进程控制块
char name[10];//进程名
int demand_time;//进程要求运行时间
int run_time;//进程已运行时间
char state;//进程的状态,初始状态都为"就绪",用"R"表示,
//当一个进程运行结束后,它的状态为"结束",用"E"表示。
struct Node *next;//指向下一个结点的指针
}*LinkList, LNode;
LinkList head, tail;//定义头指针,尾指针
int n;//进程数
void CreateList()//创建循环链表
{
head = (LinkList)malloc(sizeof(LNode));
tail = (LinkList)malloc(sizeof(LNode));
head->next = head;
tail = head;
LinkList p;
printf("请输入进程的个数:\n");
#include <cstdlib>
#include <time.h>
#include <string>
#include <windows.h>
#include <iostream>
using namespace std;
typedef struct Node {//创建进程控制块
char name[10];//进程名
int demand_time;//进程要求运行时间
int run_time;//进程已运行时间
char state;//进程的状态,初始状态都为"就绪",用"R"表示,
//当一个进程运行结束后,它的状态为"结束",用"E"表示。
struct Node *next;//指向下一个结点的指针
}*LinkList, LNode;
LinkList head, tail;//定义头指针,尾指针
int n;//进程数
void CreateList()//创建循环链表
{
head = (LinkList)malloc(sizeof(LNode));
tail = (LinkList)malloc(sizeof(LNode));
head->next = head;
tail = head;
LinkList p;
printf("请输入进程的个数:\n");