Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string wybor;
- int x = 0;
- int y = 0;
- while(cin >> wybor >> x >> y)
- {
- if (wybor == "+")
- cout << x + y << "\n";
- else if (wybor == "-")
- cout << x - y << "\n";
- else if (wybor == "*")
- cout << x * y << "\n";
- else if (wybor == "/")
- cout << x / y << "\n";
- else if (wybor == "%")
- cout << x % y << "\n";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment