#include <stdio.h>
#include <stdlib.h>
#define MAX 5 //进程数
/*短作业优先算法*/
struct pro
{
int num; //进程名
int arriveTime; //到达时间
int burst; //运行时间;
struct pro *next;
};
//函数声明
struct pro* creatList();
void insert(struct pro *head,struct pro *s);
struct pro* searchByAT(struct pro *head,int AT);
void run(struct pro *head);
void del(struct pro* p);
int getCount(struct pro *head,int time);
struct pro* creatList() //创建链表,按照进程的到达时间排列
{
struct pro* head=(struct pro*)malloc(sizeof(struct pro));
head->next=NULL;
struct pro* s;
int i;
for(i=0;i<MAX;i++)
{
s=(struct pro*)malloc(sizeof(struct pro));
printf("请输入进程名:\n");
scanf