temp link

http://www.mouseos.com/assembly/nasm03.html#01

http://www.mouseos.com/assembly/nasm03.html#01

http://blog.csdn.net/yes_life/article/details/6616967


http://blog.csdn.net/lirx_tech/article/details/43053181

http://blog.csdn.net/lirx_tech/article/details/43670001


http://blog.csdn.net/lirx_tech/article/details/42065591

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
#include <stdio.h> #include <stdlib.h> typedef struct{ char name[5]; int need_time; int privilege; char state; }NODE; typedef struct node{ NODE data; struct node *link; }LNODE; void delay(int i) { int x,y; while(i--) { x=0 ; while(x < 10000) { y = 0; while(y < 40000) y++; x++ ; } } } void len_queue(LNODE **hpt, NODE x) { LNODE *q,*r,*p; q = *hpt; 8 r = *hpt; p = (LNODE *)malloc(sizeof(LNODE)); p->data = x; p->link = NULL; if(*hpt == NULL) *hpt = p; else { while(q!=NULL && (p->data).privilege < (q->data).privilege) { r = q; q = q->link; } if(q == NULL) r->link = p; else if(r == q) { p->link = *hpt; *hpt = p; }else { r->link = p; p->link = q; } } } void lde_queue(LNODE **hpt, NODE *cp) { LNODE *p = *hpt; *cp = (*hpt)->data; *hpt = (*hpt)->link; free(p); printf("the elected process's name : %s \n",cp->name); } void output(LNODE **hpt) { LNODE *p = *hpt; printf("Name \t Need_time \t privilege \t state\n"); do { 9 printf("%s \t %d \t\t %d \t\t %c \n", (p->data).name,(p->data).need_time,(p->data).privilege,(p->data).state); p = p->link; }while(p!= NULL); delay(4); } int main() { LNODE *head = NULL; NODE curr,temp; printf("The period time is 4s \n"); printf("please input \n"); printf("if need_time = 0,input over\n"); printf("Name\t Need_time\t privilege\n"); while(1) { scanf("%s %d %d", temp.name,&temp.need_time,&temp.privilege); if(temp.need_time == 0) break; temp.state = 'R'; len_queue(&head,temp); } while(head != NULL) { output(&head); lde_queue(&head,&curr); curr.need_time-- ; curr.privilege-- ; if(curr.need_time != 0) len_queue(&head,curr); } return 0; }
最新发布
06-13

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Farmwang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值