⑴ 个人所得税的C语言编程
#include<stdio.h>
intmain()
{doublex,y,p1,p2;
while(1)
{scanf("%lf",&x);
if(x<=0)break;
x-=3500;
if(x<=1500){p1=0.03;p2=0;}
elseif(x<=4500){p1=0.1;p2=105;}
elseif(x<=9000){p1=0.2;p2=555;}
elseif(x<=35000){p1=0.25;p2=1005;}
elseif(x<=55000){p1=0.3;p2=2755;}
elseif(x<=80000){p1=0.35;p2=5055;}
else{p1=0.45;p2=13505;}
y=x*p1-p2;
printf("个人所得税=%.2lf
",y);
}
return0;
}
⑵ C语言程序设计题: 个人所得税问题。
#include<stdio.h>
int main()
{float x,y;
scanf("%f",&x);
if(x<1000)y=0;
else if(x<1500)y=0.05*(x-1000);
else if(x<2000)y=500*0.05+0.1*(x-1500);
else if(x<2500)y=500*0.05+500*0.1+0.15*(x-2000);
else y=500*0.05+500*0.1+500*0.15+0.2*(x-2500);
printf("%.2f\n",y);
return 0;
}