#include"stdio.h"
float single_tax(float income)
{
float icome,tax;
if(0<=icome<=23350)
tax=icome*0.15 ;
else if (23350<=icome<=56550)
tax=3502.50+(icome-23350)*0.28;
else if(56550<=icome<=117950)
tax=12798.50+(icome-56550)*0.31;
else if(117950<=icome <=256500)
tax=31832.50+(icome-117950)*0.36;
else if(icome>256500)
tax=81710.05 +(icome-81710.05)*0.396;
return tax ;
}
main()
{
float i;
printf("input icome:\n");
scanf("%f" ,&i);
single_tax(i) ;
printf("%f" , single_tax(i)) ;
}
编译通过,但是结果不准确!