Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- problema 429
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,c0=0,c1=0;
- cin>>n;
- while (n!=0){
- if (n%2==0)
- c1++;
- else
- c0++;
- n=n/2;
- }
- cout<<c1<<" "<<c0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement