Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int suma (nod *p)
- {
- int x,y;
- x=y=-1;
- unsigned s=0;
- while(p)
- {
- if(x == -1)
- x = p->info;
- else if(y == -1)
- y = p->info;
- else
- {
- if(p->info%2 == 0 && x%2==0 && y%2 == 1){
- s+=y;
- }
- x = y;
- y = p->info;
- }
- p = p->urm;
- }
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement