Ⅰ 个人所得税的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;
}