#includeusing namespace std;struct Node{ Node *next; int elem;};void creatList(Node* &head){ head = new Node; int elem; cin>>elem; head->elem = elem; Node *p = head; while(cin>>elem&&elem) { Node *q = new Node; q->elem = elem; p->next = q; p = p->next; } p->next = NULL;}void printList(Node* &head){ cout< elem<<" "; Node *p = head->next; while(p) { cout< elem<<" "; p = p->next; } cout< elem == x) { p = head; head = head->next; free(p); removeX(head, x); } else removeX(head->next, x);}int main(){ Node *p; creatList(p); printList(p); removeX(p, 4); printList(p); return 0;}