V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
freehehe
V2EX  ›  问与答

这个节点问题目没事吧?碰到操作系统题目不会做求帮助

  •  
  •   freehehe · 2020-06-13 10:57:31 +08:00 · 1303 次点击
    这是一个创建于 1413 天前的主题,其中的信息可能已经有所发展或是发生改变。
    下面的程序是作业调度程序的片段。请仔细阅读,找出三条错误的语句并更正之。
    typedef struct jcb
    { char na[4];
    int len,ta,rt,wt;
    struct jcb *next;
    } jcb;
    jcb *head;
    int ta;
    long mem;
    shedl()
    {
    1、 float xk,k;
    2、 jcb *p,*q,*s,*t;
    3、 do
    4、 {p=head;
    5、 s=null;
    6、 q=null;
    7、 k=0;
    8、 while (p!=null){
    9、 { if(p->len<=mem)
    10、 xk=(float)(p->wt)/p->rt;
    11、 if(q==null||xk>k)
    12、 { k=xk;q=p;t=s;}
    13、 }
    14、 s=p;
    15、 p=p->next;
    16、 }
    17、 if (q!=null)
    18、 { if(t==null)
    19、 head=head->next;
    20、 else
    21、 t->next=q->next;
    22、 mem=q->len;
    23、 ta=ta-q->ta;
    24、 printf("选中作业:%s\n",q->na);
    25、 }
    26、 } while(ta>0);

    程序说明:jcb[]-作业调度表(结构类型);na[]-作业名; len-内存长度; rt-运行时间; wt-等待时间;mem-内存长度; ta-设备台数。
    5 条回复    2020-06-13 17:37:28 +08:00
    asanelder
        1
    asanelder  
       2020-06-13 14:11:02 +08:00   ❤️ 1
    既然问问题呢,态度就要好一点点啦
    良好的排版也是对回答者的尊重哦~~~~~
    wzzzx
        2
    wzzzx  
       2020-06-13 14:55:33 +08:00   ❤️ 1
    港真,我搜问题搜到这样的代码片段都直接关掉
    Jooooooooo
        3
    Jooooooooo  
       2020-06-13 14:56:32 +08:00   ❤️ 1
    重新问吧
    EminemW
        4
    EminemW  
       2020-06-13 16:25:48 +08:00
    这代码格式让你来看,你能看得下不
    chanlk
        5
    chanlk  
       2020-06-13 17:37:28 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1249 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:53 · PVG 07:53 · LAX 16:53 · JFK 19:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.