Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(false);
- int x, y, z;
- while (cin >> x >> y >> z) {
- x >>= z;
- int reverse = 0;
- for (int i = 0; i < y; i++) {
- int thisBit = !(x % 2);
- reverse += thisBit << i;
- x >>= 1;
- }
- cout << reverse << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment