Advertisement
ErliPan

Untitled

Dec 23rd, 2020
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. void esercizio4(struct arrayList *ptr, int *ret)
  2. {
  3.     ret = 0;
  4.     while (ptr->next != NULL)
  5.     {
  6.         int max = ptr->y;
  7.         if (ptr->next->y < max)
  8.             ptr->next = ptr->next->next;
  9.         if (ptr->next->x < max)
  10.             ptr->next->x = max;
  11.         ptr = ptr->next;
  12.         (*ret)++;
  13.     }
  14.     (*ret)++;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement