Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int liczba1, liczba2;
  7. char znak;
  8. while (cin >> znak >> liczba1 >> liczba2)
  9. {
  10. if (znak == '+') { cout << liczba1 + liczba2 << endl; }
  11. if (znak == '-') { cout << liczba1 - liczba2 << endl; }
  12. if (znak == '/') { cout << liczba1 / liczba2 << endl; }
  13. if (znak == '*') { cout << liczba1 * liczba2 << endl; }
  14. if (znak == '%') { cout << liczba1 % liczba2 << endl; }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement