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: +,-,*,/: " << '/n';
  11. cin >> select;
  12.  
  13.  
  14. if (select == '+') {
  15. cout << "Enter a number: " << '/n';
  16. cin >> x;
  17. cout << "Enter a number: " << '/n';
  18. cin >> y;
  19. cout << x + y;
  20. }
  21.  
  22. return 0;
  23.  
  24.  
  25. }
  26.  
Success #stdin #stdout 0.01s 5324KB
stdin
+
10
10
stdout
Select: +,-,*,/: 12142Enter a number: 12142Enter a number: 1214220