c++课程设计——职工工资管理系统_第1页
c++课程设计——职工工资管理系统_第2页
c++课程设计——职工工资管理系统_第3页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、题目C+面向对象程序设计课程设计清单:5小题+职工工资管理系统(类、链表实现)姓名:学号:专业:计算机科学与技术学院:指导教师:2018年6月17日Part1:小程序练习1类的继承定义一个point类,包含私有数据成员x,v,成员函数包括无参构造函数,带参构造函数,set和get属性函数。定义circle类,从point类公有派生,增加数据成员半径r,成员函数包括无参构造函数,带参构造函数,计算面积函数getarea。在main函数中定义一个circle的对象,并计算其面积。/*1.定义Point类,设置其成员函数(构造函数,拷贝构造函数和析构函数)以及setx()sety()getx()ge

2、ty()匹个属性函数。2. 定义circle类,设置其成员函数(构造函数,拷贝构造函数和析构函数)以及获取半径r的函数get_r()计算面积并获取面积的函数getarea()。3. 在主函数中定义类的对象c1并初始化r=2o再调用getarea()函数输出面积*/#include<iostream>usingnamespacestd;classpoint/定义point类returnx;voidset_y(inty)this->y=y;public:intget_y()point()()point(intx,inty)returny;voidset_x(intx)privat

3、e:/私有对象xyintx;inty;this->x=x;intget_x()classcircle:publicpointpoint/circle类公有派生(public:circle()()circle(doubler,intx,inty):point(x,y)(this->r=r;)doubleget_r()(returnr;)doublegetarea()(return(3.14*r*r);运行结果分析:;输入输出>>,<<)private:intr;/circle私有对象r);intmain()(circlec1(2,3,6);cout<&l

4、t;"r="<<c1.get_r()<<endl;cout<<"该圆面积="<<c1.getarea()<<endl;system("pause");return0;)/发现问题:定义的r好像只显示出int类型主函数中r=2,输出圆面积12.562运算符重载,友元函数和this指针定义一个计数器类counter,具备自增,自减功能(前后缀)功能。在main函数里测试该类。doubleP;public:counter()()/无参构造函数counter(doublep):P(p

5、)()/带参构造函数counteroperator+();/重载前置+counteroperator+(int);/重载后置+counteroperator-();/重载前置-counteroperator-(int);/重载后置-后置+重载前置-重载后置-in,counter&a)1. /*定义counter类,私有成员数据weight,设置其成员函数2. (构造函数和析构函数)重载自加自减运算符和<<、>>运算符。3. 在主函数中实现运算符重载。4. 友元函数需要声明。*/#include<iostream>#include<cmath&g

6、t;usingnamespacestd;classcounter;istream&operator>>(istream&is,counter&a);ostream&operator<<(ostream&os,counter&a);classcounter/定义类counter(private:friendistream&operator>>(istream&is,counter&a);/声明友元,重载输入运算符>>friendostream&operator<&

7、lt;(ostream&os,counter&a);/同上);_countercounter:operator+()/前置+重载实现(+P;return*this;)countercounter:operator+(int)/实现(countera=*this;+(*this);returna;)countercounter:operator-()/实现(-P;return*this;)countercounter:operator-(int)/重载实现(countera=*this;-(*this);returna;)istream&operator>>(

8、istream&/运算符>>重载实现(in>>a.P;if(!in)cerr<<"输入错误!"<<endl;returnin;)ostream&operator<<(ostream&out,counter&a)/运算符<<重葺实现(out<<a.P;returnout;)intmain()(counterc1(236),c2(632);cout<<"c1="<<c1<<endl<<"

9、c2="<<c2<<endlcout<<"+c1="<<+c1<<endl;/测试cout<<"c1+="<<c1+<<endl;cout<<"c2-=“<<c2-<<endl;cout<<“-c2="<<-c2<<endl;system("pause");return0;)运行结果分析:定义c1的值为236,c2的值为632;此时+c1的

10、数值为237;c1+输出时为237,输出后为238;此时c2-输出时为632;-c2输出时为630,输出后为630;3虚函数和抽象类定义一个抽象类shape,包括公有的计算面积area函数,计算体积volume函数,输出基本信息函数printinfo(三个函数均为纯虚函数)。从shape公有派生point类,增加私有数据成员x,y坐标,以及构造函数,析构函数。从point公有派生circle类,增加私有数据成员半径r,以及构造函数,析构函数。从circle公有派生cylinder类,增加私有数据成员高度h,以及构造函数,析构函数。(在定义三个派生类的过程中,自己考虑需要重定义哪个虚函数)。在m

11、ain函数中,定义shape类的指针,指向派生类的对象,输出三类对象的基本信息,面积,体积;(将shape指针改为引用再尝试)/三个纯虚函数:/*先定义基类shape。设置三个纯虚函数并且声明:声明计算面积纯虚函数area();声明计算体积纯虚函数volume();声明输出基本信息纯虚函数printinfo();2.定义类point共有继承自类shape。并且在该类中实现三个纯虚函数。3. 定义类circle共有继承自类point。并且在该类中实现三个纯虚函数。4. 定义类cylinder共有继承自类circle。并且在该类中实现三个纯虚函数。在主函数中分别创建类point的对象a,circl

12、e的对象b,cylinder的对象c,并初始化;在主函数中分别定义shape类的指针和引用,调用printinfo()函数。*/#include<iostream>#include<cmath>#definePi3.141516usingnamespacestd;classshape(public:virtualdoublearea()=0;面积,体积,基本输出virtualdoublevolume()=0;virtualvoidprintinfo()=0;);classpoint:publicshape/shape派生的point类;点并没有体积面积,所以只写prin

13、tinfo函数(public:point()()point(doublex,doubley)(this->x=x;this->y=y;)voidprintinfo()(cout<<"x="<<x<<",y="<<y<<endl;)point()()private:doublex;doubley;);classcircle:publicpoint/同理;circle类(圆)需重写两个虚函数;(public:circle()()circle(doubler,doublex,doubley

14、):point(x,y)(this->r=r;)doublearea()(returnPi*r*r;)voidprintinfo()(point:printinfo();cout<<"半径为"<<r<<endl;cout<<"圆的面积是"<<area()<<endl;)circle()()private:doubler;);classcylinder:publiccircle/圆柱,同理,不运行结果:多说(public:cylinder()()cylinder(doubleh,

15、doublex,doubley,doubler):circle(x,y,r)(this->h=h;)/*doublearea()(return2*Pi*this->r+circle:area();/未实现计算圆柱表面积)*/doublevolume()(returnh*circle:area();)voidprintinfo()(circle:printinfo();cout<<"高为"<<h<<endl;cout<<"圆柱的体积是"<<volume()<<endl;)c

16、ylinder()()private:doubleh;);intmain()(cylindertemp(6,2,3,3);shape*s;/实例化一个圆柱对象s=&temp;(*s).printinfo();printf("n");cout<<"temp中数据构成的圆面积为"<<s->area()<<endl;cout<<"体积为"<<(*s).volume()<<endl;system("pause");return0;)4模板

17、编写一个使用类模板对数组进行查找、求元素和、重载下标运算符,以及输出的程序。3) 1)设计一个类模板:形式1为template<classT>classArray;形似2为template<classT,intn>classArray;用于对T类型的数组进行构造和输出;2)产生模板类Array<int>和Array<double>进行测试;产生模板类Array<int,10>和Array<double,10>进行测试。assert(sz>=0);if(count=a.getSize()a.resize(count*/

18、先实现第(2)小题#include<iostream>#include<cassert>usingnamespacestd;template<classT>classArrayprivate:T*list;intsize;public:Array(intsize=10);/构造函数Array();/析构函数T&operator(inti);/重载"”constT&operator(inti)const;Tsum(intn);intsearch(Te,intn);intgetSize()const;voidresize(intsz);

19、template<classT>Array<T>:Array(intsz)/构造函数assert(sz>=0);size=sz;list=newTsize;template<classT>Array<T>:Array()/析构函数deletelist;/重载下标运算符template<classT>T&Array<T>:operator(intn)assert(n>=0&&n<size);returnlistn;template<classT>constT&Ar

20、ray<T>:operator(intn)constassert(n>=0&&n<size);returnlistn;/取当前数组的大小template<classT>intArray<T>:getSize()constreturnsize;/将数组大小修改为sztemplate<classT>voidArray<T>:resize(intsz)if(sz=size)return;T*newList=newTsz;intn=(sz<size)?sz:size;for(inti=0;i<n;i+)

21、newListi=listi;deletelist;/删除原数组list=newList;/使list指向新数组size=sz;/更新sizetemplate<classT>TArray<T>:sum(intn)Tsum=list0;for(inti=1;i<n;i+)sum+=listi;returnsum;/查找template<classT>intArray<T>:search(Te,intn)for(inti=0;i<n;i+)if(listi=e)returni;return-1;intmain()Array<int&

22、gt;a(5);inti,n,m,count=0;cout<<"请输入数字个数:"cin>>n;for(i=1;i<=n;i+)cin>>m;if(count=a.getSize()a.resize(count*2);acount+=m;for(i=0;i<count;i+)cout<<""<<ai;cout<<endl;cout<<"数组和为:"<<a.sum(n)<<endl;cout<<"

23、数字4在数组中的位置是”<<a.search(4,n)<<endl;/*Array<double>进行测试Array<double>a(5);inti,n,m,count=0;cout<<"请输入数字个数:"cin>>n;for(i=1;i<=n;i+)cin>>m;2);acount+=m;)for(i=0;i<count;i+)cout<<setw(8)<<ai;cout<<endl;cout<<"数组和为:"

24、;<<a.sum(n)<<endl;cout<<"数字4在数组中的位置是:”<<a.search(4,n)<<endl;*/return0;)/然后实现第(3)小题#include<iostream>#include<cassert>usingnamespacestd;template<classT,intn>classArrayprivate:T*list;public:Array();/构造函数Array();/析构函数T&operator(inti);/重载"”co

25、nstT&operator(inti)const;Tsum();intsearch(Te););template<classT,intn>Array<T,n>:Array()/构造函数list=newTn;)template<classT,intn>Array<T,n>:Array()/析构函数deletelist;)/重载下标运算符template<classT,intn>T&Array<T,n>:operator(inti)returnlisti;)template<classT,intn>

26、TArray<T,n>:sum()Tsum=list0;for(inti=1;i<n;i+)sum+=listi;returnsum;)/查找template<classT,intn>intArray<T,n>:search(Te)for(inti=0;i<n;i+)if(listi=e)returni;return-1;)intmain()Array<int,5>a;inti,n,m,count=0;cout<<"请输入数字个数:"cin>>n;for(i=1;i<=n;i+)cin

27、>>m;acount+=m;)for(i=0;i<count;i+)cout<<""<<ai;cout<<endl;cout<<"数组和为:"<<a.sum()<<endl;cout<<"数字4在数组中的位置是”<<a.search(4)<<endl;/*Array<double,n>进行测试Array<double,5>a;inti,n,m,count=0;cout<<"请

28、输入数字个数:"cin>>n;for(i=1;i<=n;i+)cin>>m;if(count=a.getSize()a.resize(count*2);acount+=m;)for(i=0;i<count;i+)cout<<setw(8)<<ai;cout<<endl;cout<<"数组和为:"<<a.sum(n)<<endl;cout<<"数字4在数组中的位置是”<<a.search(4,n)<<endl;*/

29、return0;)运行结果:5文件读写定义学生类数组,有N个人(N=5),包括姓名和语数外三名课的成绩,通过重载<<和>>运算符实现学生数组的文件读写/*定义student类,私有数据成员字符数组name20;定义运算符<<,>>重载;在住函数中定义student类数组sN;并以输出和二进制的方式打开文件*/#include<iostream>#include<fstream>#include<string>#defineN5usingnamespacestd;classstudent;ostream&

30、operator<<(ostream&os,students);istream&operator>>(istream&is,student&s);classstudent/student类:姓名+4门成绩public:student()student(stringname,intchinese_socre,intmaths_score,intenglish_score)this->name=name;this->chinese_score=chinese_score;this->maths_score=maths_sco

31、re;this->english_score=english_score;friendostream&operator<<(ostream&os,students)/声明友元,重写<<、>>os<<<<""<<s.chinese_score<<""<<s.maths_score<<""<<s.english_score<<endl;returnos;friendistre

32、am&operator>>(istream&is,student&s)is>>>>s.chinese_score>>s.maths_score>>s.english_score;returnis;private:stringname;运行结果:intchinese_score;intmaths_score;intenglish_score;intmain()inti;studentsN;for(i=0;i<N;i+)/输入数据,按namescore1.cin>>si;ofstrea

33、mofs("c:testtest.txt",ios_base:out);if(!ofs)cerr<<"fileopenfailed"<<endl;exit(1);for(i=0;i<N;i+)/这个我也不太明白-ofs.write(reinterpret_cast<char*>(&si),sizeof(student);ifstreamifs("c:testtest.txt",ios_base:out);if(!ifs)cerr<<"fileopenfailed&

34、quot;<<endl;exit(1);for(i=0;i<N;i+)ifs.read(reinterpret_cast<char*>(&si),sizeof(student);for(i=0;i<N;i+)cout<<si;system("pause");return0;Part2:小型软件的开发一、设计题目职工工资管理基本要求:定义职工(employee)类,其中至少包括姓名、性别、工号、电话、所在科室和工资。功能要求:1 、设计菜单实现功能选择;、输入功能:输入职工信息,并保存到文件中;、查询功能:)能够根据工号

35、精确查询职工信息;)能够根据姓名、科室查询职工信息)分科室进行工资统计,计算各科室的平均工资、根据职工的工资排序输出、根据工号修改职工信息、根据工号删除职工信息二、运行环境Windows7x86加vc+6.0(实验室)三、算法设计的思想对于整个系统的设计思路是,首先,由员工输入用户信息,包括姓名、性别、工号、电话、所在科室和工资;然后,在计算某职工的当月工资时,系统先从已输入的职工信息文件中获取职工信息,接着调用不同的处理程序进行计算;最后将结果存档。因此可以设计一个基类employee(职工),根据用户需要employee类应该拥有的属性有:工号、姓名、电话、性别、科室和工资等。Employ

36、ee类的服务应包括:voidPrint();创建一个链表释放链表空间完成信息录入查找满足“姓名”“科室”/查找满足“科室”的/查找满足“工/显示职工信息在标准输出设备上输出修改职工信息根据工号删除职工信息/归档操作工资排序/显示格式设置employee*Create(employee*Head);/voidRel(employee*Head);/employee*Add(employee*Head);/boolSearch(employee*Head);/的职工信息intSearchPost(employee*Head,stringpost);职工信息employee*Search_Uniqu

37、e_Front(employee*Head);号”的职工信息voidDisplay_List(employee*Head);voidDisplay_Node(employee*pNode);/employee*Modify(employee*Head);/employee*Del(employee*Head);/voidSave_ByFile(employee*Head,fstream&ofile);employee*Sort(employee*Head);/四、算法的流程图五、算法设计分析1、主函数:main()显示系统工作菜单,罗列该系统所有功能。先声明所有将会调用到的函数名再运用

38、选择函数switch即可根据使用者所输入的功能代号menu进入对应的功能程序。(cout打印出相应的菜单)2、输入实现在employee类下创建一个带头节点的空链表employee*Head来传递职工的所有信息。(工号、姓名、电话、性别、科室和工资)。在函数employee*Add()中通过前插法输入所有职工的信息。用cout提示要输入的内容,接着用cin输入相应的内容。3、信息显示声明链表指针ptr,其中Head->Next用来接收调用浏览函数时所传递过来的实参,用设置好的输出格式(print()、Display()以及while循环,不为空则开始打印信息。4、查询信息1)按工号查询声

39、明链表指针ptr指向Next,cout、cin提示输入工号并赋值给code,匹配ptr中的m_code,显示匹配结果即可;2)按科室查询声明链表指针ptr指向Next,cout、cin提示输入科室并赋值给post,匹配ptr中的m_post,显示匹配结果即可;3)双匹配查询声明链表指针ptr指向Next,cout、cin提示输入工号、科室并赋值给code、post,匹配ptr中的m_cod6m_post,显示匹配结果5、修改信息通过职工的工号修改职工信息。声明链表指针ptr,调用查找函数Search_Unique_Front()找到需修改的职工信息,再次赋值即可。需要用cout提示要输入的内容

40、,接着用cin输入相应的内容。6、删除信息键盘输入的职工号,通过职工的工号code删除职工信息。链表指针匹配m_code并删除Head->Next7、计算科室平均工资在按科室查找SearchPost函数中定义一个int类型n(为科室人数),初始化为0;每添加一人,则sum+=ptr->m_Wage。用总的工资除以总人数,算出平均工资。六、源代码#include<string>#include<iostream>#include<fstream>#include<iomanip>#include<memory.h>#incl

41、ude<stdio.h>#include<conio.h>#include<stdlib.h>usingnamespacestd;intn=0;classemployeepublic:stringm_Code;/职工工号stringm_Name;stringm_phone;stringm_Sex;stringm_Post;/所在科室unsignedintm_Average;unsignedintm_Cash;unsignedintm_Wage;/链表节点的指针域-employee*Next;public:voidPrint();employee*Create

42、(employee*Head);/仓J建一个链表voidRel(employee*Head);employee*Add(employee*Head);boolSearch(employee*Head);intSearchPost(employee*Head,stringpost);employee*Search_Unique_Front(employee*Head);voidDisplay_List(employee*Head);voidDisplay_Node(employee*pNode);employee*Modify(employee*Head);employee*Del(employ

43、ee*Head);voidSave_ByFile(employee*Head,fstream&ofile);employee*Sort(employee*Head);employee*employee:Create(employee*Head)/创建一个带头节点的空链表。Head=newemployee;if(!Head)cout<<”分配内存失败!"<<endl;returnNULL;Head->m_Code=""Head->m_Name=""Head->m_phone=""

44、;Head->m_Sex=""Head->m_Post=""Head->m_Wage=0;Head->Next=NULL;Head->m_Average=0;Head->m_Cash=0;returnHead;voidemployee:Rel(employee*Head)/释放链表。employee*ptr;/声明一个操作用的指针。while(Head!=NULL)(ptr=Head;Head=Head->Next;deleteptr;/释放节点资源。)_employee*employee:Add(employe

45、e*Head)/输入职工信息(/前插法添加数据。employee*pNew;/声明一个新节点。charagain;stringcode,name,sex,post,phone;unsignedintwage;do(pNew=newemployee;/数据域。cout<<"请输入职工工号:"cin>>code;cout<<endl<<"请输入职工姓名:"cin>>name;cout<<endl<<"请输入职工电话:"cin>>phone;co

46、ut<<endl<<"请输入职工性别:"cin>>sex;cout<<endl<<"请输入职工科室:"cin>>post;cout<<endl<<"请输入职工工资:"cin>>wage;while(cin.fail()(cout<<"请输入正确的工资数据。"<<endl;cin.clear();fflush(stdin);cin>>wage;cout<<endl

47、;pNew->m_Code=code;pNew->m_Name=name;pNew->m_phone=phone;pNew->m_Sex=sex;pNew->m_Post=post;pNew->m_Wage=wage;/指针域。pNew->Next=Head->Next;Head->Next=pNew;cout<<"数箱添加成功!是否继续添加?(Y/N)"<<endl;cin>>again;while(again='Y'|again='y');retur

48、nHead;boolemployee:Search(employee*Head)(/查询同时满足“姓名”和“科室”的职工信息。employee*ptr;stringname,post;ptr=Head->Next;cout<<"请输入所在科室:"cin>>post;cout<<endl<<"请输入姓名:"cin>>name;cout<<endl<<"tt查询结果"<<endl;Print();while(ptr)(if(ptr->

49、;m_Name=name)&&(ptr->m_Post=post)(-Display_Node(ptr);/打印满足条件的节点。returntrue;ptr=ptr->Next;/查询下一节点。cout<<"n无此职工的信息。"<<endl;returnfalse;employee*employee:Search_Unique_Front(employee*Head)/根据工号查找(employee*ptr;stringcode;ptr=Head->Next;cout<<"请输入职工工号:&qu

50、ot;cin>>code;cout<<endl<<"tt查询结果"<<endl;Print();while(ptr)(if(ptr->m_Code=code)Display_Node(ptr);returnptr;ptr=ptr->Next;cout<<"n无此职工的信息。"<<endl;returnfalse;intemployee:SearchPost(employee*Head,stringpost)employee*ptr;doublesum=0;intn=0;p

51、tr=Head->Next;while(ptr)if(ptr->m_Post=post)sum+=ptr->m_Wage;n+;ptr=ptr->Next;cout<<"科室"<<post<<"里的平均工资为:"<<sum/n<<endl;return0;voidemployee:Print()cout<<setw(10)<<left<<"工号";cout<<setw(10)<<left<

52、;<"姓名";cout<<setw(18)<<left<<"电话";cout<<setw(10)<<left<<"性别";cout<<setw(10)<<left<<"科室";cout<<setw(10)<<left<<"工资"<<endl;_voidemployee:Display_List(employee*Head)/显示职工信息

53、employee*ptr;ptr=Head->Next;cout<<"tt=所有职工信息="<<endl;Print();while(ptr)Display_Node(ptr);ptr=ptr->Next;voidemployee:Display_Node(employee*pNode)/在标准输出设备上输出。cout<<setw(10)<<left<<pNode->m_Code<<setw(10)<<left<<pNode->m_Name<<

54、setw(18)<<left<<pNode->m_phone<<setw(10)<<left<<pNode->m_Sex<<setw(10)<<left<<pNode->m_Post<<setw(10)<<left<<pNode->m_Wage<<endl;/setw(10)表示占10个字符位置。employee*employee:Modify(employee*Head)/修改职工信息/修改单一个节点。employee*ptr

55、;ptr=Search_Unique_Front(Head);stringcode,name,sex,post,phone;unsignedintwage;if(ptr)cout<<"tt你现在可以修改此职工的信息了"<<endl;/数据域。cout<<"请输入职工工号:";cin>>code;cout<<endl<<"请输入职工姓名:";cin>>name;cout<<endl<<"请输入职工电话号码:";

56、cin>>phone;cout<<endl<<"请输入职工性别:";cin>>sex;cout<<endl<<"请输入职工所在科室:";cin>>post;cout<<endl<<"请输入职工工资:";cin>>wage;while(cin.fail()cout<<"请输入正确的工资数据。"<<endl;cin.clear();fflush(stdin);cin>&g

57、t;wage;cout<<endl;ptr->m_Code=code;ptr->m_Name=name;ptr->m_phone=phone;ptr->m_Sex=sex;ptr->m_Post=post;ptr->m_Wage=wage;elsecout<<"没找到此职工的记录,无法修改。"<<endl;returnHead;employee*employee:Del(employee*Head)/根据工号删除职工信息stringcode;employee*parentptr;employee*ptr

58、_front;cout<<"请输却工工号:";cin>>code;parentptr=Head;ptr_front=Head->Next;while(ptr_front)if(ptr_front->m_Code=code)parentptr->Next=ptr_front->Next;deleteptr_front;returnHead;parentptr=ptr_front;ptr_front=ptr_front->Next;returnHead;voidemployee:Save_ByFile(employee*He

59、ad,fstream&ofile)employee*pNode;pNode=Head->Next;ofile.clear();/清除文件结束状态。while(pNode)ofile<<setw(10)<<left<<pNode->m_Code<<setw(10)<<left<<pNode->m_Name<<setw(10)<<left<<pNode->m_phone<<setw(10)<<left<<pNode->

60、m_Sex<<setw(10)<<left<<pNode->m_Post<<setw(10)<<left<<pNode->m_Wage<<endl;/setw(10)表示占10个字符位置。pNode=pNode->Next;cout<<"数据文件保存成功!"<<endl;employee*employee:Sort(employee*Head)/工资排序(/我创建的是带头节点的链表。用直接插入法。if(Head->Next=NULL)|(Hea

61、d->Next->Next=NULL)cout<<"tt*)/此步条件判断非常有价值。*,<<endl;(cout<<"tt*采单选顶cout<<"数据节点数少于2个,不用排序!*"<<endl;"<<endl;cout<<"tt*returnHead;*"<<endl;cout<<"tt*1.注册职工2.修改信息3.删/第二步;除信息4.信息查询*"<<endl;emplo

62、yee*ptr;cout<<"tt*5.保存文件6.工资排行7.信employee*ptr_F;息显示0.退出系统*"<<endl;employee*ptr_N;cout<<"tt*ptr=Head->Next->Next;*"<<endl;ptr_F=Head;Head->Next->Next=NULL;/到此,分成了两个链表。cout<<"tt*/第三步。*,<<endl;while(ptr)cout<<endl<<&qu

63、ot;请选择相应操作菜单项:";(cin>>menu;ptr_N=ptr->Next;while(cin.fail()ptr_F=Head;/ptr_F的归位。(while(ptr_F->Next)cout<<"请选择正确的菜单选项。"<<endl;(cin.clear();if(ptr->m_Wage>ptr_F->Next->m_Wage)fflush(stdin);(cin>>menu;ptr->Next=ptr_F->Next;ptr_F->Next=ptr;switch(menu)break;(case0:elsecout<&l

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论