📄 wage.cpp
字号:
#include"worker.h"
#include"company.h"
#include<iostream>
#include<string>
using namespace std;
void menu(company &thecompany);
long main()
{
company acompany;
for(;;)
menu(acompany);
return 0;
}
void menu(company &thecompany)
{
long index;
cout<<" 菜单"<<endl;
cout<<"1.数据输入"<<endl;
cout<<"2.数据统计"<<endl;
cout<<"3.数据打印"<<endl;
cout<<"4.退出"<<endl;
cin>>index;
switch(index)
{
case 1:
{
long index2;
cout<<"1.添加员工 2.删除员工"<<endl;
cin>>index2;
switch(index2)
{
case 1:
{
char word=0;
while(word!='q')
{
thecompany.addworker();
cout<<"出入\"q\"结束数据输入,其他字母继续输入。"<<endl;
cin>>word;
}
break;
}
case 2:
{
char word=0;
while(word!='q')
{
thecompany.deleteworker();
cout<<"出入\"q\"结束数据输入,其他字母继续输入。"<<endl;
cin>>word;
}
break;
}
default:
cout<<"选择错误。"<<endl;
}
break;
}
case 2:
{
char w;
cout<<"正在处理数据......."<<endl;
thecompany.sort();
thecompany.tsmadd();
cout<<"数据处理完毕。"<<endl<<"出入\"y\"开始打印。"<<endl;
cin>>w;
if(w=='y')
thecompany.printout();
break;
}
case 3:
{
thecompany.printout();
break;
}
case 4:
{
exit(1);
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -