Untitled
unknown
plain_text
10 months ago
247 B
6
Indexable
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int count = 0;
while(n)
{
if(n%2 == 1)
{
count++;
}
n = n>>1;
}
cout<<count<<endl;
}Editor is loading...
Leave a Comment