Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- int main(void) {
- unsigned short numb, tmp = 0;
- cin >> numb;
- numb >>= 8;
- tmp = numb;
- for (int i = 0; i < 8; ++ i) {
- numb <<= 1;
- numb |= tmp & 1;
- tmp >>= 1;
- }
- cout << numb << "\n";
- return 0;
- }
- /*
- 1100 0111 0011 0100 (50996) => 1100 0111 1110 0011 (51171)
- 1010 1001 1111 0000 (43504) => 1010 1001 1001 0101 (43413)
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement