#include<stdio.h>
#include<stdlib.h>
typedef struct Node {
int data;
Node* next;
} node;
void insert(node* head, int a, int b) {
while (a--) {
head = head->next;
}
node* temp = (node*)malloc(sizeof(node));
temp->data = b;
temp->next = head->next;
head->next = temp;
}
void Delete(node* head, int a) {
int temp = a - 1;
while (temp--) {
head = head->next;
}
}
int main() {
node* head = (node*)malloc(sizeof(node));
node* posi = (node*)malloc(sizeof(node));
head->next = posi;
head->data = 0;
int mem;
int n;
scanf("%d", &n);
while (n--) {
scanf("%d", &mem);
posi->data = mem;
posi->next = (node*)malloc(sizeof(node));//开辟新节点
posi = posi->next;
posi->next = NULL;
}
posi = head->next;
while (posi->next != NULL) {
printf("%d ", posi->data);
posi = posi->next;
}
}
描述该段代码的算法思想。即具体的描述代码的算法过程等。