// Programming beauty question. This question has two restrictions. The deleted node cannot be the first or last one. // 1. the last node cannot be deleted because it points to a deleted pointer. // 2. why cannot I delete the first node? // Use the CAPTCHA technology to delete the next node and copy the data of the next node to the previous node # include <stdio. h> # include <stdlib. h> # include <assert. h> typedef struct node {int data; node * Next;}; void deletemidnode (node * P) {assert (P! = NULL); node * pnext = p-> next; If (pnext! = NULL) {P-> next = pnext-> next; P-> DATA = pnext-> data; Delete pnext ;}} void print (node * HD) {// P ++ is written here. The error for (node * P = HD-> next; P = p-> next) printf ("% d ", p-> data); printf ("\ n");} int main () {int A [5] = {1, 2, 3, 4, 5 }; node * head = new node; head-> next = NULL; For (INT I = 0; I <5; I ++) {node * TMP = new node; TMP-> DATA = A [I]; TMP-> next = head-> next; head-> next = TMP;} print (head ); deletemidnode (Head-> next); print (head); System ("pause"); Return 0 ;}