Guest User

Untitled

a guest
Jan 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string wybor;
  9.     int x = 0;
  10.     int y = 0;
  11.  
  12.     while(cin >> wybor >> x >> y)
  13.     {
  14.     if (wybor == "+")
  15.     cout << x + y << "\n";
  16.     else if (wybor == "-")
  17.     cout << x - y << "\n";
  18.     else if (wybor == "*")
  19.     cout << x * y << "\n";
  20.     else if (wybor == "/")
  21.     cout << x / y << "\n";
  22.     else if (wybor == "%")
  23.     cout << x % y << "\n";
  24.     }
  25.  
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment