ProgMe

Untitled

May 31st, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define int int64_t
  3.  
  4. using namespace std;
  5.  
  6. void solve()
  7. {
  8. int type, a, b;
  9. cin >> type >> a >> b;
  10. switch (type)
  11. {
  12. case 1:
  13. cout << a + b;
  14. break;
  15. case 2:
  16. cout << a - b;
  17. break;
  18. case 3:
  19. cout << a * b;
  20. break;
  21. case 4:
  22. cout << a / b;
  23. break;
  24. case 5:
  25. cout << a % b;
  26. break;
  27. default:
  28. cout << "Input is not correct";
  29. break;
  30. }
  31. cout << "\n";
  32. }
  33.  
  34. int32_t main()
  35. {
  36. ios::sync_with_stdio(false);
  37. cin.tie(0);cout.tie(0);
  38. int q;
  39. cin >> q;
  40. while (q--)
  41. solve();
  42. }
Advertisement
Add Comment
Please, Sign In to add comment