fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. long double a,b,sum;
  6. char z;
  7. cin >> a>>z>>b;
  8. if (z=='+'){
  9. sum=a+b;
  10. cout << "= " << sum << endl;
  11. return 0;
  12. }
  13.  
  14. else if (z=='-'){
  15. sum=a-b;
  16. cout << "= " << sum << endl;
  17. return 0;
  18. }
  19.  
  20. else if (z=='*'){
  21. sum=a*b;
  22. cout << "= " << sum << endl;
  23. return 0;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 3460KB
stdin
9 * 11
stdout
= 99