#include<stdio.h>#include<stdlib.h>#defineN9typedefstructnode{intdata;structnode*next;}ElemSN;ElemSN*Createlink(inta[],intn){inti;ElemSN*h=NULL,*p,*t;for(i=0;i<N;i++){p=(ElemSN*)malloc(sizeof(ElemSN));p->data=a[i];if(!h)//建立只有一个结点的循环链表h=t=p;else//结点数目大于1p->next=h;//建立循环链表t=t->next=p;//标记链表的尾结点}returnh;}voidPrintlink(ElemSN*h){ElemSN*p;p=h;do{//dowhile循环输出printf("%2d\n",p->data);p=p->next;}while(p!=h);}intmain(void){inta[N]={1,2,3,4,5,6,7,8,9};ElemSN*head;head=Createlink(a,9);Printlink(head);}