#include
int main()
{
double a,b,c;
char d;
scanf("%lf%c%lf",&a,&d, &b); //输入格式为符号在中间,double是%lf ,你写反了
switch(d)
{
case'+': c=a+b;break;
case'-': c=a-b;break;
case'*': c=a*b;break;
case'/':
if(b!=0)
c=a/b;
else //否则给c赋值0
c=0;
break;
}
printf("%lf\n",c); //double是%lf
return 0;
}
#include
int main()
{
double a, b, c;
char d;
scanf("%lf %c %lf", &a, &d, &b);
switch (d)
{
case'+': c = a + b; break;
case'-': c = a - b; break;
case'*': c = a*b; break;
case'/':
if (b > 0)
c = a / b; break;
}
printf("%f", c);
return 0;
}