#include<stdio.h>#include<stdlib.h>structTest{int data;structTest*next;};voidprintlink(structTest*head)//链表动态遍历{structTest*point;
point = head;while(point !=NULL){printf("%d ",point ->data);
point = point ->next;}putchar('\n');}structTest*insertNodehead(structTest*head)//头插法动态创建链表{structTest*new =head;while(1){
new =(structTest*)malloc(sizeof(structTest));printf("input your node data\n");scanf("%d",&(new->data));if(new->data==0){printf("0 quit\n");return head;}if(head ==NULL){
head = new;}else{
new->next = head;
head = new;}}return head;}intmain(){structTest*head;
head =NULL;
head =insertNodehead(head);//头插法动态创建链表printlink(head);return0;}```