全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 优先级进程调度算法 public class progress public string jincheng; public int youxianji; public int ntime; public progress(string jincheng, int youxianji, int ntime) this.jincheng = jincheng; this.youxianji = youxianji; this.ntime = ntime; public class diaodu static public int pertime = 10; public static void Main() diaodu dia = new diaodu(); progress pro; Console.WriteLine(请输入进程的个数:); int num = Convert.ToInt32(Console.ReadLine(); pro = new progressnum; for (int i = 0; i != num; i+) Console.Write(请输入进程名:); string name = Console.ReadLine(); Console.Write(请输入进程优先级:); int pri = Convert.ToInt32(Console.ReadLine(); Console.Write(请输入进程运行时间:); int tim = Convert.ToInt32(Console.ReadLine(); proi = new progress(name, pri, tim); dia.print(pro); public void print(progress pro) while (true) int k = 0; int max = pro0.youxianji; for (int i = 0; i != pro.Length; i+) if (proi.youxianji = max) max = proi.youxianji; k = i; prok.youxianji-; if (prok.ntime != 0) Console.Write(就绪的进程为:); for (int i = 0; i != pro.Length; i+) if (proi.ntime != 0 & i != k) Console.Write(proi.jincheng + t); Console.WriteLine(); if (prok.ntime = pertime) if (prok.ntime = pertime) Console.WriteLine(当前运行的进程:0运行时间为:1,进程到达的时间为:2 运行结束, prok.jincheng, pertime, k + 1); else Console.WriteLine(当前运行的进程:0运行时间为:1,进程到达的时间为:2, prok.jincheng, pertime, k + 1); prok.ntime -= pertime; else if (prok.ntime 0) Console.WriteLine(当前运行的进程:0运行时间为:1,进程到达的时间为:2 运行结束, prok.jincheng, prok.ntime, k + 1); prok.ntime = 0; bool flag = false; for (int j = 0; j
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 英语人教PEP版四年级上教案Unit 3 My friends
- 网络安全与信息保密知识测试考试及答案
- 人才培养方案
- 2026年中职教师笔试试题库及答案(名校卷)
- 2025年最-新教师资格证考试(中学)教育知识与能力真题与答案
- 皮革加工各类试题及标准答案汇编
- 公路工程预算定额宝典
- 中药炮制学典型试题与答案分享
- 有关严重违章的考试试题及参考答案
- 星座情感测试题目及详细答案
- 科研院所廉洁科研管理制度
- 牛羊肉深加工项目可行性研究报告
- 《高等数学(第2版)》 高职 全套教学课件
- 2024年警辅人员招聘考试题库及答案
- DL-T620-1997交流电气装置的过电压保护和绝缘配合
- 幼儿园每月食品安全调度会议纪要
- 大型医院巡查工作汇报材料
- 非自行指示秤检定员试卷
- 新编建筑施工扣件式钢管脚手架安全技术规范
- 分包商月度考核表
- GPP解读与医院制剂管理思考
评论
0/150
提交评论