Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
186 B
1
Indexable
Never
#include <iostream>

int main() {
	unsigned int n;
	std::cin >> n;
	
	std::cout << "0 ";
	for (unsigned int s = 1; s <= n; s *= 2) {
		std::cout << s << ' ';
	}

	return 0;
}