#include #include "list.h" using namespace std; void solve(list *&h, list *&t) { list *cur = h; while (cur) { if (cur->inf % 2 == 0) { list *tmp = cur; cur = cur->next; del_node(h, t, tmp); } else cur = cur->next; } } int main() { int n; cout << "n = "; cin >> n; list *head = NULL; list *tail = NULL; int x; for (int i = 0; i < n; i++) { cin >> x; push(head, tail, x); } solve(head, tail); print(head, tail); cout << endl; return 0; }