2018年11月3日

摘要: /*非抢占式优先级调度算法*/ #include using namespace std; struct Num { int priority; //优先级 int dt; //到达时间 int st; //运行时间 }sum[5]={{2,0,3},{3,2,2},{5,2,5},{1,5,3},{4,8,1}}; int main() { int c=0; //... 阅读全文
posted @ 2018-11-03 13:27 梓离 阅读(4653) 评论(0) 推荐(0)
摘要: /*抢占式优先级调度算法*/ #include using namespace std; struct Num { int priority; //优先级 int dt; //到达时间 int st; //运行时间 int need_time; //还需运行的时间 }sum[5]={{2,0,3,3},{3,2,2,2},{5,2,5,5},{1,5,3,3},{4,8... 阅读全文
posted @ 2018-11-03 13:23 梓离 阅读(6060) 评论(0) 推荐(0)
摘要: /*时间片轮转调度算法*/ #include #define MAX 50 struct a_struct { char name[10]; //进程名字 int number; //进程编号 float dt; //到达时间 float begin_time; //开始运行时间 float st; //服务时间 float end_time; //完成时间 in... 阅读全文
posted @ 2018-11-03 13:21 梓离 阅读(2784) 评论(0) 推荐(1)
摘要: /* 短作业优先调度 */ #include struct sjf{ char name[10]; float dt;//到达时间 float st;//服务时间 float begin_time;//开始运行时间 float wct;//运行完成时间 float zt;//周转时间 float dczt;//带权周转时间 }; sjf a[100]; void input(s... 阅读全文
posted @ 2018-11-03 13:16 梓离 阅读(527) 评论(0) 推荐(0)
摘要: /* 先来先服务 */ #include #define MAX 50 struct Gzuo{ int id; //进程名字 int dt; //到达时刻 int st; //服务时间 int wct; //完成时刻 float zt; //周转时间 float dczt; //带权周转时间 }; Gzuo a[MAX]; void main(){ int i,j,min... 阅读全文
posted @ 2018-11-03 13:10 梓离 阅读(367) 评论(0) 推荐(0)
摘要: /* 待分析的简单语言的语法 用扩充的BNF表示如下: ⑴::=beginend ⑵::={;} ⑶::= ⑷::=ID:= ⑸::={+ | -} ⑹::={* | / ⑺::=ID | NUM | () */ #include "stdio.h" #include "string.h" char prog[100],token[8],ch;//prog[100],用来存储要处理的对象,to... 阅读全文
posted @ 2018-11-03 12:40 梓离 阅读(1620) 评论(0) 推荐(0)
摘要: // Lexical_Analysis.cpp : 定义控制台应用程序的入口点。 // #include "stdio.h" #include "stdlib.h" #include "string.h" #include "iostream" using namespace std; //词法分析程序 //首先定义种别码 /* 第一类:标识符 letter(letter | digit)*... 阅读全文
posted @ 2018-11-03 12:30 梓离 阅读(714) 评论(0) 推荐(0)

2018年10月11日

摘要: 南开100题——酷勤网 阅读全文
posted @ 2018-10-11 15:36 梓离 阅读(125) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define N 400 //最大显示信息条数上限 8 int nummax=0; //全局数组有效的最大长度 9 int numstore[N]; //存储信息位... 阅读全文
posted @ 2018-10-11 09:44 梓离 阅读(686) 评论(0) 推荐(0)

2018年10月3日

摘要: 100个经典C语言程序(益智类) 100个经典C语言程序(益智类) 【1.绘制余弦曲线】 在屏幕上用“*”显示0~360度的余弦函数cos(x)曲线 [问题分析与算法设计] 利用cos(x)的左右对称性,将屏幕的行方向定义为x,列方向定义为y,则0~180度的图形与180~360度的图形是左右对称的 阅读全文
posted @ 2018-10-03 12:47 梓离 阅读(1189) 评论(0) 推荐(0)

导航