这是一个求税收的switch 函数 求大佬帮我看一下我哪里写错了 不管输入什么都是0.00
#include <stdio.h>double calTaxt(double number);
int main()
{ double z=0,m ;
printf("请输入您本月的收入总额(元):");
scanf("%lf", &m);
calTaxt(m);
printf("您需要交税:%.2lf\n", z);
return 0;
}
double calTaxt(double number)
{
double m, z;
double y ; //表示超出起征点的收入
int f;
y=m-3500;
if( y<= 0.0)
z=0;
else
{
if( y <= 1500)
f = 1;
else if(y <= 4500)
f= 2;
else if(y <= 9000)
f= 3;
else if(y <= 35000)
f= 4;
else if(y <= 55000)
f= 5;
else if(y <= 80000)
f= 6;
else
f= 7;
switch(f)
{
case 1: z=y*0.03; break;
case 2: z=y*0.10-105;break;
case 3: z=y*0.20-555; break;
case 4: z=y*0.25-1005; break;
case 5: z=y*0.30-2755; break;
case 6: z=y*0.35-5505; break;
case 7: z=y*0.45-13505;
}
}
return z ;
}