#include <stdio.h>
int main()
{
float a,b;
char ch;
while(1)
{
printf("please enter:");
scanf("%f%c%f",&a,&ch,&b);
switch(ch)
{
case '+': printf("a+b=%f\n",a+b);break;
case '-': printf("a-b=%f\n",a-b);break;
case '*': printf("a*b=%f\n",a*b);break;
case '/': printf("a/b=%f\n",a/b);break;
default : printf("error\n");break;
}
}
return 0;
}
int main()
{
float a,b;
char ch;
while(1)
{
printf("please enter:");
scanf("%f%c%f",&a,&ch,&b);
switch(ch)
{
case '+': printf("a+b=%f\n",a+b);break;
case '-': printf("a-b=%f\n",a-b);break;
case '*': printf("a*b=%f\n",a*b);break;
case '/': printf("a/b=%f\n",a/b);break;
default : printf("error\n");break;
}
}
return 0;
}