这个程序属于什么进程?急急!

来源:百度知道 编辑:UC知道 时间:2024/06/05 04:20:27
#include "stdio.h"
#include <stdlib.h>
#include <conio.h>
#define getpch(type) (type*)malloc(sizeof(type))
#define NULL 0
struct pcb {
char name[10];
char state;
int super;
int ntime;
int rtime;
struct pcb* link;
}*ready=NULL,*p;
typedef struct pcb PCB;
int sort()
{
PCB *first, *second;
int insert=0;
if((ready==NULL)||((p->super)>(ready->super)))
{
p->link=ready;
ready=p;
}
else
{
first=ready;
second=first->link;
while(second!=NULL)
{
if((p->super)>(second->super))
{
p->link=second;
first->link=p;
second=NULL;
insert=1;
}
else
{
first=first->link;
second=second->link;
}
}
if(insert==0) first->link=p;
} return 0;
}

input()
{
int i,num;
system

先是input输入你想运行的进程数量,名字,运行时间,然后交给space建立进程列表,再传给check检查进程状态,然后running运行空循环执行进程,按预定的执行时间一一执行,全部完毕后再交回main。不过,最后一个ch=getchar()似乎没意义,应该可以删掉

c语言的