?? wage.cpp
字號:
#include<iostream.h>
struct admin
{
float wage;
int age;
};
struct worker
{
float wages;
int hour;
int ages;
};
struct messager
{
float wagess;
int agess;
float get;
};
struct workers
{
float wagers;
float gets;
};
double admins()
{
admin s;
double h;
cout<<"輸入管理員的工資和工齡年"<<endl;
cin>>s.wage>>s.age;
return h=s.wage+(s.age*50);
}
double workerss()
{
worker s;
double h;
cout<<"輸入工人的工資,工時和工齡"<<endl;
cin>>s.wages>>s.hour>>s.ages;
return h=s.wages+(100*s.hour)+(s.ages*50);
}
double messagers()
{
messager s;
double h;
cout<<"輸入銷售經(jīng)理的工資,工齡和銷售量"<<endl;
cin>>s.wagess>>s.agess>>s.get;
return h=s.wagess+(s.agess*50)+(s.get*0.005);
}
double workeres()
{
workers s;
double h;
cout<<"輸入銷售員的工齡和銷售量"<<endl;
cin>>s.wagers>>s.gets;
return h=(50*s.wagers)+(s.gets*0.05);
}
void main()
{ int a;
do{
cout<<"1.管理員"<<endl<<"2.工人"<<endl<<"3.銷售經(jīng)理"<<endl<<"4.銷售員"<<endl<<"5.exit"<<endl;
cin>>a;
if(a==1) cout<<"管理員為"<<admins()<<"元"<<endl;
if(a==2) cout<<"工人為"<<workerss()<<"元"<<endl;
if(a==3) cout<<"銷售經(jīng)理為"<<messagers()<<"元"<<endl;
if(a==4) cout<<"銷售部"<<workeres()<<"元"<<endl;
}while(a!=5);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -