Untitled
Anonymous
plain_text
12/10/2024 8:24 PM
332 B
17
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