这个程序哪里有问题,请指教
#include <stdio.h>
float add(float x,float y)
{return(x+y);}
float sub(float x,float y)
{return(x-y);}
float dev(float x,float y)
{return(x/y); }
float mul(float x,float y)
{return(x*y);}
main()
{
float a,b;
char c;
printf("input two numbers:\n");
scanf("%f%f",&a,&b);
printf("input the character:\n");
scanf("%c",&c);
float (*p)(float,float);
switch(c)
{
case '+' : p=add;printf(" %f\n",(*p)(a,b));break;
case '-': p=sub;printf("%f\n",(*p)(a,b));break;
case '/': p=dev;printf(" %f\n",(*p)(a,b));break;
case '*' : p=mul;printf(" %f\n",(*p)(a,b));break;}}
这个程序哪里有错,请指教,我在C-FREE上运行到输入符号时就结束了,不再继续执行了。