修改了两个地方,代码如下:
#包含
int main()
{双重税,税率;
intalary,d;
printf(“输入您的月薪”);
scanf(“%d”和薪水); // int类型为%d,后跟地址获取
如果(薪水<= 3500)
{
费率= 0;
d = 0; //将此if语句更改为此,如果未分配d,程序将崩溃
}
elseif(薪水<= 5000)
{rate = 0.03;
d = 105;
elseif(工资<= 8000)
{rate = 0.1;
d = 555;
{rate = 0.2;
d = 1005;
{rate = 0.25;
d = 2755;
{rate = 0.3;
{费率= 0.35;
d = 5505;
}其他
{比率= 0.45;
税=税率*(salary-3500)-d;
printf(“您应支付的个人所得税为lf元\ n%,税);
return0;
#include“” stdio.h“
intmain(无效){
双打,rs,老鼠;
Printf(“请输入您的电话号码... \ ns =“);
Scanf(“%lf”,&s);
如果(rs = s-2000,rs <500)
大鼠= 0.05;
否则(rs> = 500 && rs <2000)
大鼠= 0.1;
Elseif(rs> = 2000 && rs <5000)
大鼠= 0.15;
大鼠= 0.2;
大鼠= 0.25;
大鼠= 0.3;
大鼠= 0.35;
大鼠= 0.4;
大鼠= 0.45;
Printf(“ YOURSGS:%。2f \ tTAX:%。2f \ tAGS:%。2f \ n”,s,rat * rs,s-rat * rs);
返回0;
#include“ stdio.h”
重复计数(整数a,整数b)
double c = a-b-3500;
如果(c <= 0)
c = 0;
否则,如果(c <= 1500)
c = c * 0.03;
否则,如果(c <= 4500)
c = c * 0.1-105;
否则,如果(c <= 9000)
c = c * 0.2-555;
c = c * 0.25-1005;
c = c * 0.3-2755;
c = c * 0.35-5505;其他
返回c;
无效的main()
int选择;
而(1)
printf(“ \ t \ t个人所得税计算器\ n”);
printf(“ 1。计算个人所得税\ n”);
printf(“ 2. Exit \ n”);
printf(“请输入选项(1或2):”);
scanf(“%d”,并选择);
如果(选择== 2)
休息;
否则,如果(选择== 1)
内部付款,宝贤;
printf(“ \ n输入您的月收入:”);
scanf(“%d”,&pay);
printf(“ \ n输入您的三份保险和一金:”);
scanf(“%d”,&baoxian);
printf(“您的个人所得税为:%0.2f”,计数(薪水,宝贤));
printf(“ \ n \ t \ t >>>注意:请输入1或2 <<< \ n”);