#include<stdio.h>#include<math.h>//使用fabs()函数要调用math.h头文件intmain(){char ch;double a, b;scanf("%lf %c %lf",&a,&ch,&b);//运算符是字符型数据switch(ch){case'+':printf("%.2lf", a + b);break;case'-':printf("%.2lf", a - b);break;case'*':printf("%.2lf", a * b);break;case'/'://注意除法运算运算时,除数不能为0,要讨论if(fabs(b)<1e-10)printf("Wrong input!\n");elseprintf("%.2f", a / b);break;default:printf("Wrong input!\n");break;}}