fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // Input
  6. int a, b;
  7. char c;
  8. cin >> a >> b >> c;
  9.  
  10. // Process -> Output
  11. if (c == '+') cout << a + b;
  12. else if (c == '-') cout << a - b;
  13. else if (c == '*') cout << a * b;
  14. else if (c == '/') cout << (float)a / b;
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5320KB
stdin
2 4
stdout
Standard output is empty