Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define int int64_t
- using namespace std;
- void solve()
- {
- int type, a, b;
- cin >> type >> a >> b;
- switch (type)
- {
- case 1:
- cout << a + b;
- break;
- case 2:
- cout << a - b;
- break;
- case 3:
- cout << a * b;
- break;
- case 4:
- cout << a / b;
- break;
- case 5:
- cout << a % b;
- break;
- default:
- cout << "Input is not correct";
- break;
- }
- cout << "\n";
- }
- int32_t main()
- {
- ios::sync_with_stdio(false);
- cin.tie(0);cout.tie(0);
- int q;
- cin >> q;
- while (q--)
- solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment