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