```c #include <stdio.h> #include <stdlib.h> typedef struct Node { int data; struct Node* next; } Node; Node* createList() { Node* head = NULL; Node* p, * prev; int num; scanf("%d", &num); while (num != -1) { p = (Node*)malloc(sizeof(Node)); p->data = num; p->next = NULL; if (head == NULL) { head = p; } else { prev->next = p; } prev = p; scanf("%d", &num); } return head; } void printList(Node* head) { Node* p = head; while (p != NULL) { printf("--%d", p->data); p = p->next; } printf("\n"); } void reversePrintList(Node* head) { if (head == NULL) { return; } reversePrintList(head->next); printf("--%d", head->data); } int main() { Node* head = createList(); reversePrintList(head); return 0; } ``` [2024-06-17 15:04:31 | AI写代码神器 | 649点数解答]