Advertisement
a53

Echilibrat

a53
Jan 3rd, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. int echilibrat(int n)
  2. {
  3. int np=0,ni=0,poz=0;
  4. while(n)
  5. {
  6. if(poz%2)
  7. ni+=n%10;
  8. else
  9. np+=n%10;
  10. n/=10,++poz;
  11. }
  12. if(ni%2==1&&np%2==0)
  13. return 1;
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement