Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
258 B
1
Indexable
Never
std::cout << ":> ";
	unsigned int n;
	std::cin >> n;
	int size = sizeof(unsigned int) * 8 - 1;

	unsigned int new_n = 0;

	for (int i = size; i >= 0; --i) {
		bool b = ((1 << (size - i)) & n);
		new_n |= (b << i);
	}

	std::cout << new_n << '\n';