urn0;}}///////输出所有PCB的初始值voidprint_init(PCB*pcb){PCB*temp=pcb->next;cout<<("\nIDpriorityCPUtimeALLtimeState");while(temp!=NULL){cout<<"\n"<<temp->ID<<""<<temp->priority<<""<<temp->CPUtime<<""<<temp->ALLtime;if(temp->State==0)cout<<("ready");elseif(temp->State==1)cout<<("running");elsecout<<("blocked");temp=temp->next;}}///////输出进程属性信息voidprint(PCB*pcb){PCB*temp;temp=pcb;if(pcb->ID==0)cout<<("\nTheidlepeocessidrunning!");else{cout<<"\n"<<temp->ID<<""<<temp->priority<<""<<temp->CPUtime<<""<<temp->ALLtime;if(temp->State==0)cout<<("ready");elseif(temp->State==1)cout<<("running");elsecout<<("blocked");}}///////将item插入到队列中,使得插入后,队列中按照优先级从高到低有序voidinsert_queue(PCB*queue,PCB*item){PCB*p,*q;q=queue;p=q->next;while(p!=0&&p->priority>=item->priority){q=p;p=p->next;}if(p==0){item->next=0;q->next=item;