问题:
算法设计:
直接根据题意暴力写出
源代码:
#include<stdio.h>
int main()
{
int a;
double b=0.0;
if(a<=3500)
printf("不征收");
else
{
if(a>=3500&&a<=4500)
{
b=1500*0.03+(a-1500)*0.1;
}
if(a>=4500&&a<=9000)
{
b=1500*0.03+3000*0.1+(a-4500)*0.2;
}
if(a>=9000&&a<=35000)
{
b=45+300+900+(a-9000)*0.25;
}
if(a>=35000&&a<=55000)
{
b=45+300+900+6500+(a-35000)*0.3;
}
if(a>=55000&&a<=80000)
{
b=45+300+900+6500+6000+(a-55000)*0.35;
}
if(a>=80000)
{
b=45+300+900+6500+6000+8750+(a-80000)*0.45;
}
}
printf("%lf",b);
}