Guest User

Untitled

a guest
May 27th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Poly Poly::pick(const Poly & p,int conv)
  2. {
  3. Poly np;
  4. Term t;
  5. Node * curr = head;
  6. Node * curp = p.head;
  7. if(conv != 0)
  8. {
  9. while(curr)
  10. {
  11. if(curr->data <= t)
  12. remove(curr->data);
  13. else
  14. np += curr->data;
  15. curr = curr->next;
  16. }
  17. while(curp)
  18. {
  19. if(conv == -1)
  20. {
  21. if(curp->data <= t)
  22. remove(curp->data);
  23. else
  24. {
  25. t = curp->data-=conv;
  26. np += t;
  27. }
  28. }
  29. else if(conv == 1)
  30. {
  31. if(curp->data <= t)
  32. remove(curp->data);
  33. else
  34. np += curp->data;
  35. }
  36. curp = curp->next;
  37. }
  38. }
  39. else
  40. {
  41. while(curp)
  42. {
  43. while(curr)
Add Comment
Please, Sign In to add comment