fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. char select;
  7. int x;
  8. int y;
  9.  
  10. cout << "Select: +,-,*,/: " << endl;
  11. cin >> select;
  12.  
  13.  
  14. if (select == '+') {
  15. cout << "Enter a number: " << endl;
  16. cin >> x;
  17. cout << "Enter a number: " << endl;
  18. cin >> y;
  19. cout << x + y;
  20. }
  21.  
  22. return 0;
  23.  
  24.  
  25. }
Success #stdin #stdout 0.01s 5284KB
stdin
10
10
stdout
Select: +,-,*,/: