You are viewing a single comment's thread. Return to all comments →
// slightly modified #include <iostream> using namespace std; int main(){ int n; cin >> n; int cnt = 0, max = 0; while (n) { if (n & 1) { if (++cnt > max) max = cnt; } else cnt = 0; n >>= 1; } cout << max << endl; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →