




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Learn General Secretary on two to learn a strengthening four Consciousnesses important speech caused a strong reaction in the country. Time, watching red treasure, the origin of building the party back to power, how to strengthen services for the masses, improve party cohesion, fighting to become the grass-roots party members and masses hot topic. Grass-roots party organizations two is to strengthen the service of party members and cadres, the pioneer spirit. Distribution of grass-roots party organizations in all walks of people, clothing, shelter, which belongs to the nerve endings of the party organization and comments reputation has a direct perception of the masses. Strengthen the party ahead of the pedal spirit; strengthen the party members and cadres success does not have to be me and the first to bear hardships, the last to service spirit to set the partys positive image among the people is important. Grass-roots party organizations two is to cleanse all people not happy not to see stereotypes, establish the honest faithful, diligent faith for the people. No need to avoid mentioning that, some members of our party can not stand the money, corrosion of temptation, thin, Xu Zhou, such abuse and corrupt bribery, malfeasance borers, and rats. Two, is to clean up, thin, Xu, Zhous solution to restore the partys fresh and natural, solid and honest work style. Cleansing take, eat, card, undesirable and behaviour, cross, hard and cold, push attitude. Grass-roots party organizations two is to strengthen the sense of ordinary party members, participating in consciousness, unity consciousness. For reasons known, members of grass-roots party branches less mobile, less resources, and the construction of party organizations have some lag. Two studies, is to focus on the grass-roots party branches loose, soft, loose problem, advance the party members and cadres, a gang working, Hong Kong report. Strong cleanup actions, style and rambling, presumptuous unqualified party members, pays special attention to party members and cadres joining party of thought problem. Party building is obtained in the long-term development of our partys historical experience accumulated. Two is our party under the new historical conditions, strengthen the partys construction of a new rectification movement. Grass-roots party organizations should always catch the hard work, results-oriented. Two educational outcomes are long-term oriented and become an important impetus for the work. Two should have three kinds of consciousness two study and education, basic learning lies in the doing. Only the Constitution address the series of party rules, and do solid work, be qualified party members had a solid ideological basis. Only the learning and do real unity, to form a learn-learn-do-do the virtuous cycle, and ultimately achieve the fundamental objective of education. This requires that the Organization课程设计报告姓名:张晓静 学号: 班级:11计本班四班题目:实时监控报警系统。建立一个报警和出警管理信息系统。要求:(1)采用一定的存储结构存储报警信息,要求有内容、时间;(2)有一次的出警就应该在待处理的信息中删除这条信息;(3)记录出警信息;(4)待处理信息过多时会发出警告。一、问题分析和任务定义。有题目可知,我们需要建立一个报警、出警系统,这个课题的重点有如下几点:(1) 用什么样的存储结构储存报警信息。(2) 如何实现报警和出警这两项主要功能。(3) 如何将出警信息保存下来,以待查询。(4) 报警信息储存过多时需要发出警告。经过一学期的数据结构的学习,我学习到了链表这一种数据结构,考虑到需要储存以及删除一些信息,所以我选择用链表来储存报警信息,且可以将上述的任务要求转化成一下几点:(1) 用链表储存报警信息以及出警信息。(2) 报警即将输入的信息储存在链表A里,我将会对链表A进行插入操作,将出警信息插入到A中; 出警则是对储存报警信息的链表进行删除,首先查找到相应的信息,再对链表A进行删除操作,并用链表B储存删除的结点。(3) 输出储存在链表B中的结点信息,即可知道出警信息。(4) 对储存报警信息的链表A进行遍历,若它的结点个数过多,则发出警告。二、数据结构的选择和概要设计。由以上的问题可知,我选择使用链表这一种数据结构来完成我的程序。由于报警时要求有内容有时间、出警时则可以根据案件的编号或者是报案的时间出警,所以链表中结点的类型是结构体。typedef structint num; /编号 char time30; /时间 char matter50; /内容datatype;typedef struct nodedatatype data;struct node *next ;Listnode;所用到的数据结构:numnext域timematter对于本次的课程设计,我的主要思路是:在主函数中输出一个菜单,让用户选择需要执行的操作,包括报警、出警、查看出警记录、退出程序。再编写子函数,子函数有插入函数:void insertnode(linklist head,Listnode *x);删除函数:int delnode(linklist head,Listnode *x); 查找函数(以便查找到需要删除的出警记录):Listnode *listfind(linklist head); 输出出警记录函数:void printlist(linklist head); 完成主要的功能。子函数之间的调用如下:Insertnode()/插入函数主函数 delnode()listnode()/删除函数和查找函数void main() printflist()/输出函数三、详细设计和编码。(1)链表的结构类型如下:typedef structint num; /编号 char time30; /时间 char matter50; /内容datatype;typedef struct nodedatatype data;struct node *next ;Listnode;定义指向Listnode结构体的指针类型;Listnode *linklist,*A,*B;A指向未处理的报警信息的链表头结点,B指向报警信息的链表头结点(2) 编写主函数,主函数中使用switch()语句,case1:中解决出警问题,调用插入函数,记录下出警记录,并提示用户已经报警成功。但是由于题目要求报警信息储存过多时需要发出警告,首先对链表A进行遍历,若A的结点个数过多则输出警告信息,如下:设置一个整型变量jj,遍历到链表A有一个结点jj则加1,以此来 记录结点的个数。 int jj=0; h=A-next; while(h) /通过链表遍历来确定有多少节点 jj+; h=h-next; if(jj3) /此时已有3次警务未处理 printf(累计多次警务未处理,建议立即处理警务!); break; 插入函数void insertnode(linklist head,Listnode *x); 首先在case1中定义一个链表x,要求用户输入报警的信息,包括时间内容编号,将信息存储在x中,再将x插入到链表A中,插入的过程是:首先寻找合适的插入位置,再利用指针,进行插入。void insertnode(linklist head,Listnode *x)Listnode *p1,*p2;p1=head;p2=p1-next ;while(p2!=NULL& ( p2-data.num data.num ) /寻找插入位置 p1=p2;p2=p2-next ;p1-next =x; /按编号大小顺序插入x-next =p2;这样不断地执行case1的操作,就会得到一个从头结点算起编号由小到大的链表,报警操作成功。case2中调用删除函数,其中删除函数delnode()中调用了查找函数,所以先介绍查找函数查找函数分按照编号查找和按时间查找,如果按编号查找,由于链表是从头结点开始编号由小到大的,所以比较需要查找的数字与链表中结点的编号的大小,若需要查找的数字大于链表中结点编号则指针p往后移,直至找到结点,返回指针p。如果按照时间查找,则半段用户输入的时间这个字符串是否与链表结点中的时间字符串相等,若不等指针p还是往后移,直至查找到节点,返回p。Listnode *listfind(linklist head) /查找某节点Listnode *p;int num;char time30;int n; printf(tt1.按编号查询n); /两种查找方式printf(tt2.按时间查询n);printf(tt请选择:n);p=head-next ; scanf(%d,&n);if(n=1&p!=NULL)printf(请输入要查找的编号:); scanf(%d,&num);while(p-next!=NULL& (p-data .num next ;if(p=NULL|(p-data .num data .time,time)!=0) /比较字符串是否相同p=p-next ;return p;而删除函数首先查找到需要出警的结点,从p指向的第一个结点开始,检查该结点中的num,或time值是否等于输入的要求删除的那个编号或时间。如果相等就将该结点删除,如不相等,就将p后移一个结点,再如此进行下去,直到遇到表尾为止。int delnode(linklist head,Listnode *g) Listnode *p,*q; p=listfind(head); /执行查找函数 if(p=NULL)printf(没有查找到该事件n);return 0; else q=head;/保存头结点while(q!=NULL&q-next=p)q-next =p-next ;*g=*p; free(p);return 1; 在case3中则调用输出函数,对储存出警情况的链表B进行输出。先将p结点的指针指向第一个结点,将p结点(即第一个结点)的数据输出。然后再将p结点的指针指向p指针的的指针(即下一结点),将p结点(即第一结点)的数据输出。重复执行此步聚直到p指针指向NULL为止。void printlist(linklist head) Listnode *p; p=head-next ; /将第一个节点赋给p if(p=NULL) printf(没有信息!nn); return; /返回空 printf(编号 时间 内容 n); while(p!=NULL) printf(%dt%st%sn,p-data.num,p-data.time,p-data.matter); p=p-next ; 4、 上机调试过程曾经出现的错误:(1) 在定义结构体的时候,把时间和内容定义的是字符串,但是在主函数中却编写scanf(%d%c%c,&x-data .num,&x-data .time,&x-data .matter);,导致程序出现死循环的情况。(2) 在查找函数中,要求用户输入按照1、按编号,2、按时间查找,程序里有一个if()语句,我一开始将里面的条件设为if(n=1),if(拿)这样编写以后程序还是能够运行,但是程序有一个漏洞,就是当你报警一次再出警一次之后,链表里应该没有了之前的记录,如果再出一次警应该显示“没有信息”,但是实际上再出一次警之后,程序就不能正常显示了。最后仔细查看之后将if里的条件改为if(n=1&p!=NULL),考虑到了若出警的链表A为空的情况。5、 测试结果及其分析。(1) 首先出现菜单界面(2) 报警,输入案件的编号、时间、内容,输入完毕显示用户已经报警。(3) 再次报警,多次报警的话会出现警告,提示未处理的信息过多。(4) 出警,按照编号或者时间查找到案件,随后提示已经出警。(5) 查询出警情况,将会显示出警的信息,包括案件的编号、报案时间、报案内容。(6) 退出程序。6、 用户使用说明。(1)程序执行后首先出现的是一个选择菜单,请根据菜单进行选择。(2)在实现报警功能时需要输入编号、时间、内容三大项,请注意编号请输入整形字符,时间和内容可以输入任意字符串。(3)本程序以C语言编写,可以完成报警、出警、查询出警情况、提示未处理的案件过多的功能。七、参考文献。1作者:王昆仑、李红书名:数据结构与算法出版地:北京出版商:中国铁道出版社出版时间:2006年7月第一版。八、 附录。#include#include/字符串处理 #includetypedef structint num; /编号 ,这里用int 的型在后面比较大小时方便一点char time30; /时间 char matter50; /内容datatype;typedef struct nodedatatype data;struct node *next ;Listnode,*linklist; /链表,定义了指向Listnode结构体的指针类型Listnode *listfind(linklist head); /查找void insertnode(linklist head,Listnode *x); /报警及出警保存记录(相当于链表的插入)int delnode(linklist head,Listnode *x); /出警(相当于链表的删除,但该过程出警后,要在删除之前把节点插入到另一个链表中(保存记录的链表)void printlist(linklist head); /输出所有未出警的和已出警的信息/*主函数*/void main() int k; int jj=0; /jj表示未处理的警务数量 Listnode *x; Listnode *h; Listnode *y;Listnode *A,*B;/A是未处理的报警记录的链表头结点,B是已经出警的记录链表A=(Listnode *)malloc(sizeof(Listnode);B=(Listnode *)malloc(sizeof(Listnode);A-next =NULL; /把指针域置空,这里A,B是头结点,没有信息的B-next =NULL;while(12) printf(t-欢迎使用实时监控报警系统-n); printf(t-报警请按1-n); printf(t-出警请按2-n); printf(t-查询出警情况请按3-n); printf(t-退出请按0-n); scanf(%d,&k); switch(k) case 0: printf(tt感谢您的使用!); exit(0);/正常结束程序运行 case 1: h=A-next; while(h) /通过链表遍历来确定有多少节点 jj+; h=h-next; if(jj2) /此时已有10次警务未处理 printf(累计多次警务未处理,建议立即处理警务!n); break; else printf(请输入:); printf(编号tt时间tt内容:); x=(Listnode *)malloc(sizeof(Listnode); scanf(%d%s%s,&x-data .num,&x-data .time,&x-data .matter); insertnode(A,x); printf(已报警!n); break; case 2: y=(Listnode *)malloc(sizeof(Listnode); if(delnode(A,y)/在删除成功执行下列语句,如果删除不成功,在函数delnode()里有提示并返回值0 。 printf(%d %s %s,y-data .num ,y-data .time ,y-data .matter); printf(已出警!n); insertnode(B,y); / 出警之后在把节点信息插入到B中保存记录 break; case 3: /printf(未处理的警务有:); /printlist(A); printf(已处理的警务有:); printlist(B); break; /*插入即报警功能*/void insertnode(linklist head,Listnode *x)Listnode *p1,*p2;p1=head;p2=p1-next ;while(p2!=NULL& ( p2-data.num data.num ) /寻找插入位置 p1=p2;p2=p2-next ;p1-next =x; /按编号大小顺序插入x-next =p2;/return p;/*查找功能*/Listnode *listfind(linklist head) /查找某节点Listnode *p;int num;char time30;int n; printf(tt1.按编号查询n); /两种查找方式printf(tt2.按时间查询n);printf(tt请选择:n);p=head-next ; scanf(%d,&n);if(n=1&p!=NULL)printf(请输入要查找的编号:); scanf(%d,&num);while(p-next!=NULL& (p-data .num next ;if(p=NULL|(p-data .num data .time,time)!=0) /这里是判断两个字符串是否相等,用strcmp().p=p-next ;return p;/*删除即出警功能*/int delnode(linklist head,Listnode *g) Listnode *p,*q; p=listfind(head); /执行查找函数 if(p=NULL)printf(没有查找到该事件n);return 0; else q=head;/保存头结点 while(q!=NULL&q-next=p)q-next =p-next ;*g=*p; free(p); return 1; /*输出功能*/ void printlist(linklist head) Listnode *p; p=head-next ; /将第一个节点赋给p if(p=NULL) printf(没有信息!nn); return; /返回空 printf(编号 时间 内容 n); while(p!=NULL) printf(%dt%st%sn,p-data.num,p-data.time,p-data.matter); p=p-next ; 写作不但能培养学生的观察力、联想力、想象力、思考力和记忆力,它的重要性更表现在于学生对字词句的运用、对思想语言和口头语言的提炼、对现实生活知识经验的总结升华、对情感价值观的宣泄。learning education, need three kinds of consciousness: one is to establish an integrated awareness. Learning and do what car isTwo-wheel, bird wings, need to go hand in hand, one end can be neglected. Communist theoretician and man. Only by closely combining theory and practice together in order to truly realize their value. Learning is the Foundation, the Foundation is not strong, shaking; Is the key to net to net thousands of accounts. Two education, lay the basis, going to do the key grip, so that the learning and doing back to standard, so that the majority of party members learn learning theory of nutrients, in the doing practice partys purposes. Second, to establish a sense of depth. Learning and do not Chu drawn, entirely different, but the organic unity of the whole. Two learning education, we need to explore integrating learning in do, exhibit do in Science. To avoid the learning into simple room instruction, do into a monotone for doing. Should exploration learn in the has do, do in the has learn of education and practice of carrier, makes general grass-roots members can in learn in the has do of achievements sense, in do in the has learn of get sense, real makes party of theory brain into heart, put for people service concept outside of Yu shaped. Third, to adhere to long-term the awareness. Style construction on the road forever, two had to catch the long-term. Two study and education, by no means, assault-style wind-sport, but the recurrent education within the party. In recent years, the partys mass line education practice and three-three special education in grass-roots borne rich fruits, vast numbers of party members and
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 第5课 做一次电影市场分析说课稿-2025-2026学年初中信息技术粤高教版2018七年级下册-粤高教版2018
- 2025商业合作合同书范本
- 2025企业违约、强制解雇、裁员均触犯合同法规定
- 2025二手简单装修购房合同书
- 2024-2025学年高中历史 第四单元 王安石变法 第2课 王安石变法的主要内容(2)教学说课稿 新人教版选修1
- 4.2 设计制作用集成电路制作收音机说课稿-2025-2026学年高中物理上海科教版选修2-1-沪教版2007
- 绍兴事业单位笔试真题2025
- 2025【合同范本】建筑材料采购合同范本
- 2025退休人员劳务合同模板
- 2025博骜丽景春天项目商品房销售代理合同
- 半导体车间安全培训课件
- 2025-2030中国聚酯TPU薄膜行业运营态势与前景动态预测报告
- 慢性结肠炎的诊断治疗讲课件
- pos机收款管理制度
- 公司电瓶车车棚管理制度
- 儿童游乐园活动方案
- 朗格汉斯细胞病诊疗研究进展
- 2025-2030中国钙钛矿光伏产业运行态势展望与投资前景规模研究研究报告
- T/CAPE 11005-2023光伏电站光伏组件清洗技术规范
- 理性思维的重要性试题及答案
- 2024江苏苏州市常熟农商银行网络金融部招聘4人笔试历年典型考题及考点剖析附带答案详解
评论
0/150
提交评论