税收工资分级
作者:互联网
#include <stdio.h>
#include <windows.h>
#define single 1
#define host 2
#define married 3
#define divorce 4
int main(void)
{
int a=0,b=0;
printf("请输入类别(single=1,host=2,married=3,divorce=4)type=%d\n",a);
printf("请输入money=%d\n",b);
while (scanf_s("%d%d", &a, &b) == 2)
{
if ((a == single) && (b<= 17850))
printf("Tax is %lf", b*0.15);
else if ((a == single) && (b > 17850))
printf("Tax is %lf",17850*0.15+(b-17850)*0.28);
else if ((a == host) && (b<=23900))
printf("Tax is %lf", b*0.15);
else if ((a == host) && (b > 23900))
printf("Tax is %lf", 23900 * 0.15 + (b - 23900)*0.28);
else if ((a == married) && (b <= 29750))
printf("Tax is %lf", b*0.15);
else if ((a == married) && (b > 29750))
printf("Tax is %lf", 29750 * 0.15 + (b - 29750)*0.28);
else if ((a == divorce) && (b <= 14875))
printf("Tax is %lf", b*0.15);
else if ((a == divorce) && (b > 14875))
printf("Tax is %lf", 14875 * 0.15 + (b - 14875)*0.28);
else
continue;
}
system("pause");
return 0;
}
标签:lf,工资,分级,Tax,else,0.15,&&,printf,税收 来源: https://www.cnblogs.com/huqi001/p/15070471.html