#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include
using namespace std;
int main(void)
{
char choose='\0';
do
{
system("cls");
printf("\n| |\n");
printf("| 请输入选项编号(0/1) |\n");
printf("| |\n");
printf("| 1:计算个人所得税 |\n");
printf("| 0:退出 |\n");
printf("| |\n");
choose=getch();
switch(choose)
{
case'1':printf("您选择了计算个人所得税\n");
t1(); break;
case'0':printf("退出程序\n");
exit (0);
default:printf("%c为非法选项!",choose);
}
printf("\n 按任何键返回\n");
getch();
}while(1);
return 0;
}
int t1()
{
double s,t = 0,i = 0;
double v;
double r, o;
cout<<"请输入您的年收入总额(元):";
cin>>s;
v = s - 60000;
if(v <=0.0)
t = 0.0;
else
{
if(v <= 36000)
r = 0.03, o = 0.0;
else if(v <= 144000)
r = 0.1, o = 2520.0;
else if(v <=300000 )
r = 0.2, o = 16920.0;
else if(v <= 420000)
r = 0.25, o = 31920.0;
else if(v <= 660000)
r = 0.3, o = 52920.0;
else if(v <= 960000)
r = 0.35, o = 85920.0;
else
r = 0.45, o= 181920.0;
t = v * r - o;
}
cout<<"您的年个人所得税为 "<<t<<" 元。\n";
cout<<"谢谢使用!\n";
return 0;
}