各位帮我看看到底程序哪里出问题啊?
#include
void main()
{
char grade;
int salary = 1000;
double amt;
printf("从键盘输入员工级别grade:");
scanf("%f",&grade);
{if (grade=='A')
printf("%f\n",amt = salary + (salary * 0.45));
else
{ if(grade=='B')
printf("%f\n",amt = salary + (salary * 0.40));
else
{if(grade=='C')
printf("%f\n",amt = salary + (salary * 0.30));
else
{if(grade == 'D')
printf ("%f\n",amt = salary + (salary * 0.25));
}
}
}
printf("无效的等级");
}
}
为什么程序执行结果总是显示“无效的等级”???