#include <stdio.h>
#include <stdlib.h>
int main()
{
char operator;
double n1, n2;
printf("please enter an operator(+-*/):");
scanf("%c",&operator);
printf("please two num:");
scanf("%lf%lf",&n1,&n2);
switch(operator)
{
case'+':
printf("%f+%f=%f",n1,n2,n1+n2);
break;
case'-':
printf("%f-%f=%f",n1,n2,n1-n2);
break;
case'*':
printf("%f*%f=%f",n1,n2,n1*n2);
break;
case'/':
if(n2!=0)
printf("%f/%f=%f",n1,n2,n1/n2);
break;
default:
printf("error");
}
return 0;
}