alex326

Untitled

Jan 22nd, 2018
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. problema 429
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,c0=0,c1=0;
  8. cin>>n;
  9. while (n!=0){
  10. if (n%2==0)
  11. c1++;
  12. else
  13. c0++;
  14. n=n/2;
  15. }
  16. cout<<c1<<" "<<c0;
  17. }
Add Comment
Please, Sign In to add comment