代码如下:
#include <stdio.h>
#include <stdlib.h>
struct LNode
{
int a1;
int b1;
struct LNode *next;
};
int main(int argc, char *argv[])
{
int a[]={1,3,2,4,6,5,7,9,8,0,3,4,5,6};
int b[]={90,56,43,454,54,33,55,44,3,434,432,343,23,43};
struct LNode *boy,*boy3;
boy=(struct LNode*)malloc(sizeof(struct LNode));
boy->next=NULL;
boy3=boy;
int c;
for(c=0;c<14;c++)
{
struct LNode *boy2;
boy2=(struct LNode*)malloc(sizeof(struct LNode));
boy2->a1=a[c];//*输入信息
boy2->b1=b[c];
boy2->next=NULL;
boy3->next=boy2;
boy3=boy2;
}
struct LNode *boy00;
boy00=boy->next;
while(boy00->next)
{
boy00=boy00->next;//*zhidaozuihou直到最后一个结点
}
boy00->next=boy->next;//*形成循环链表
struct LNode *boy8;
boy8=boy->next;
int o;
for(o=0;o<28;o++)
{
printf("%d\t%d\n",boy8->a1,boy8->b1);
boy8=boy8->next;
}
system("pause");
return 0;
}
程序运行结果: