#include <iostream>
#include<stdio.h>
#include<string.h>
#include<fstream>
#include<malloc.h>
using namespace std;
typedef struct node
{
char name;
int come;
int service;
int start;
int finish;-------
float roundtime;//周转时间
float wroundtime;//带权周转时间
struct node *next;
}work;
char PCB[30][3];
char name[30];
int come[30];
int service[30];
int k1;
void init()
{
int i=0,j=0;
cout<<"请输入要创建进程的个数"<<endl;
cin>>k1;
cout<<"━━━━━━━━━━━━━━━━━━━━━━━━━━━━"<<endl;
while(i!=k1)
{
cout<<"请输入要创建进程的进程名称:"<<endl;
cin>>PCB[i][0];
cout<<"请输入要创建进程的到达时间:"<<endl;
cin>>PCB[i][1];
cout<<"请输入要创建进程的服务时间:"<<endl;
cin>>PCB[i][2];
i++;
cout<<"━━━━━━━━━━━━━━━━━━━━━━━━━━━━"<<endl;
}
for(i=0;i<=k1;i++) //分类存储 名字,到达时间,服务时间
{
name[i]=PCB[i][0];
come[i]=PCB[i][1]-'0';
service[i]=PCB[i][2]-'0';
}
}
void initw(work *w) //初始化
{
w->name=NULL;
w->come=-1;
w->service=-1;
w->finish=-1;
w->start=-1;
w->roundtime=-1.0;
w->wroundtime=-1.0;
w->next=NULL;