怎样实现多次运算
#include<stdio.h>void main()
{
float a,b;
char c;
printf("input expression:a+(-,*,/)b \n");
scanf("%f%c%f",&a,&c,&b);
switch(c)
{
case '+':
printf("%f\n",a+b);
break;
case '-':
printf("%f\n",a-b);
break;
case '*':
printf("%f\n",a*b);
break;
case '/':
printf("%f\n",a/b);
break;
default:
printf("input error!\n");
}
}
一个四则运算,但怎样实现让程序能运算多次呢?