Advertisement
Meruem

elimina multipli di 3 e posiz >=5

Jun 20th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function tre_list(l)
  2. {
  3.     var prev,c1=0,n={};
  4.     if(l==null){return;}
  5.     for(prev=l.testa;prev!=null;prev=prev.succ)
  6.     {
  7.         c++; if(c==1 || c==3 ||c==4)
  8.         {
  9.             n={x:prev.x++};
  10.             n.succ=prev.succ;
  11.             prev.succ=n;
  12.         }
  13.     }
  14.     return l;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement