简单的计算器功能,哪错了???求解答
#include<stdio.h>
float count(float a,char b,float c);
int main(void)
{
float a,c;
char b;
printf("请输入一个算式:\n");
scanf("%f%c%f",&a,&b,&c);
printf("结果为:%f",count(a,b,c));
return 0;
}
float count(float a,float b,float c)
{
switch (b)
{
case'+':return a+c;break;
case'-':return a-c;break;
case'*':return a*c;break;
case'/':return a/c;break;
}
}