fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin >> n;
  8.  
  9. for (int i = 0; i < 5; i++)
  10. {
  11. char ope;
  12. int x;
  13. cin >> ope >> x;
  14.  
  15. if (ope == '+')
  16. {
  17. n = n + x;
  18. }
  19. else if (ope == '-')
  20. {
  21. n = n - x;
  22. }
  23. else if (ope == '*')
  24. {
  25. n = n * x;
  26. }
  27. }
  28.  
  29. cout << n << endl;
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
952404768