#include <stdio.h> #include <stdio.h> int main() { double a, b; char f; scanf("%lf %c %lf", &a, &f, &b); //判断部分 if (f == '+' || f == '-' || f == '*' || f == '/') { switch (f) { case '+': printf("%.4lf+%.4lf=%.4f", a, b, a + b); break; case '-': printf("%.4lf-%.4lf=%.4f", a, b, a - b); break; case '*': printf("%.4lf*%.4lf=%.4f", a, b, a*b); break; case '/': if (b == 0) { printf("Wrong!Division by zero!"); } else printf("%.4lf/%.4lf=%.4f", a, b, a / b); break; } } else printf("Invalid operation!"); return 0; }