Website Summary Files Commits Branches @commit @diff @stats
path: root / Week14 / Exercise04.cpp
blob: d02ef6b2de8b2f82f1f999e549dad4fb860d075a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

int main() {
	unsigned int x;
	std::cin >> x;

	unsigned first  = (x & (0b11111111 << 24)) >> 24;
	unsigned second = (x & (0b11111111 << 16)) >> 16;
	unsigned third  = (x & (0b11111111 << 8))  >> 8;
	unsigned fourth =  x &  0b11111111;

	std::cout << first << ' ' << second << ' ' << third << ' ' << fourth << std::endl;

	return 0;
}