switch case计算个人所得税

using namespace std;
#include
int main()
{
float x,z;
int y;
do
{
cout<<“请输入月工资:”;
cin>>x;
if(x<=1800)
{
z=0;
cout<<“个人所得税为:”< }
else
{
y=(x-1800)/1000;
switch(y)
{
case 0:
z=(x-1800)0.1;
cout<<“个人所得税为:”< break;
case 1:
z=1000
0.1+(x-2800)0.15;
cout<<“个人所得税为:”< break;
case 2:
z=1000
0.1+(x-2800)0.15;
cout<<“个人所得税为:”< break;
case 3:
z=1000
0.1+(x-2800)0.15;
cout<<“个人所得税为:”< break;
case 4:
z=1000
0.1+(x-2800)0.15;
cout<<“个人所得税为:”< break;
case 5:
z=1000
0.1+(x-2800)0.15;
cout<<“个人所得税为:”< break;
default:
z=1000
0.1+4000*0.15+(x-6800)*0.2;
cout<<“个人所得税为:”< break;
}
}
}while(x>0);
return 0;
} switch case计算个人所得税_第1张图片在这里插入图片描述

你可能感兴趣的:(DEV,C++,c++)