Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void task3()
- {
- int k, count = 0;
- struct Stack *beforeLast = NULL;
- scanf("%d", &k);
- run = L;
- while (run->next != NULL) {
- if (run->next->inf == k) {
- ++count;
- beforeLast = run;
- }
- run = run->next;
- }
- if (count > 0) {
- run = beforeLast->next;
- beforeLast->next = beforeLast->next->next;
- free(run);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement