#include <iostream>
#include <iomanip>
using namespace std;
int hour(double a)//时薪子函数
{
double c;
c=a/174;
cout<<fixed<<showpoint<<setprecision(2)<<"时薪为"<<c<<endl ;
return c;
}
int tax(double d,double e)//个人所得税
{
double i;
double g;
double h;
double f;
double p;
double q;
f=hour(d);
g=f*1.5*e+d;
h=g-3500;
if(h<=0) i=0,p=0;
else if(!(h<=1500||h>0)) i=0.03,p=0;
else if(!(h<=4500||h>1500)) i=0.1,p=105;
else if(!(h<=9000||h>4500)) i=0.2,p=555;
else if(!(h<=35000||h>9000)) i=0.25,p=1055;
else if(!(h<=55000||h>35000)) i=0.3,p=2755;
else if(!(h<=80000||h>55000)) i=0.35,p=5505;
else if(h>80000) i=0.4,p=13505;
q=h*i-p;
cout<<fixed << showpoint << setprecision(2) <<"个人所得税为"<<i<<endl;
return i;
}
int main(double j,double k,double l,double m,double n,double o)
{
cout<<"工资计算器"<<endl;
system ("pause");
cout<<"请输入您的月薪"<<endl;
cin>>j;
cout<<"请输入您本月加班时间"<<endl;
cin>>k;
l=hour(j);//时薪
m=l*1.5*k;//加班费
n=tax(j,k);//个税
o=j+m-n-103;//实发工资
cout<< fixed << showpoint << setprecision(2) <<"您本月的工资为"<<o<<endl;
}
#include <iomanip>
using namespace std;
int hour(double a)//时薪子函数
{
double c;
c=a/174;
cout<<fixed<<showpoint<<setprecision(2)<<"时薪为"<<c<<endl ;
return c;
}
int tax(double d,double e)//个人所得税
{
double i;
double g;
double h;
double f;
double p;
double q;
f=hour(d);
g=f*1.5*e+d;
h=g-3500;
if(h<=0) i=0,p=0;
else if(!(h<=1500||h>0)) i=0.03,p=0;
else if(!(h<=4500||h>1500)) i=0.1,p=105;
else if(!(h<=9000||h>4500)) i=0.2,p=555;
else if(!(h<=35000||h>9000)) i=0.25,p=1055;
else if(!(h<=55000||h>35000)) i=0.3,p=2755;
else if(!(h<=80000||h>55000)) i=0.35,p=5505;
else if(h>80000) i=0.4,p=13505;
q=h*i-p;
cout<<fixed << showpoint << setprecision(2) <<"个人所得税为"<<i<<endl;
return i;
}
int main(double j,double k,double l,double m,double n,double o)
{
cout<<"工资计算器"<<endl;
system ("pause");
cout<<"请输入您的月薪"<<endl;
cin>>j;
cout<<"请输入您本月加班时间"<<endl;
cin>>k;
l=hour(j);//时薪
m=l*1.5*k;//加班费
n=tax(j,k);//个税
o=j+m-n-103;//实发工资
cout<< fixed << showpoint << setprecision(2) <<"您本月的工资为"<<o<<endl;
}