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

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

	unsigned bitCounter = 0;
	while (x > 0) {
		bitCounter ^= x;
		x >>= 1;
	}

	std::cout << (bitCounter & 1) << std::endl;

	return 0;
}