Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. nodoL* stacca(nodo * &L, int*A){
  2. if(!L && A[0]>=1){
  3. return 0;
  4. }
  5. if(A[0]==1 && L){
  6. nodo* cacca=L;
  7. if(L->next==0){
  8. L=0;
  9. }
  10. else{
  11. L=L->next;
  12. }
  13. nodoL* peppina=new nodoL(cacca, 0);
  14. return peppina;
  15. }
  16. else{
  17. A[0]=A[0]-1;
  18. nodoL*bubu = stacca(L->next, A);
  19. if(bubu==NULL){
  20. return 0;
  21. }
  22. else{
  23. nodoL* pepo = new nodoL(L,bubu);
  24. return pepo;
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement