Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int echilibrat(int n)
- {
- int np=0,ni=0,poz=0;
- while(n)
- {
- if(poz%2)
- ni+=n%10;
- else
- np+=n%10;
- n/=10,++poz;
- }
- if(ni%2==1&&np%2==0)
- return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement