该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include "Stdio.h"
#include "Conio.h"
typedef struct list
{
char name[20];
struct list *Lpnext;
}LISTTYPE;
int main(void)
{
/* 此处添加你自己的代码 */
int i,j,k;
LISTTYPE L1,L2,L3,L4,L5,L6,*Lhead,*PLIST;
Lhead=&L1;
L1.Lpnext=&L2;
L2.Lpnext=&L3;
L3.Lpnext=&L4;
L4.Lpnext=&L5;
L5.Lpnext=&L6;
L6.Lpnext=&L1;
PLIST=Lhead;
for(i=0;i<6;i++)
{
k=0;
while((j=getchar())!='\n')
{
PLIST->name[k]=j;
k++;
if(k>19) break;
}
PLIST=PLIST->Lpnext;
}
PLIST=Lhead;
for(i=0;i<6;i++)
{
k=0;
printf("\n");
while((PLIST->name[k])!='\0')
{
printf("%c",PLIST->name[k]);
k++;
}
PLIST=PLIST->Lpnext;
}
getch();
return 0;
}
下面是输出结果:
输入
ligang
wangyan
zhouhong
huawen
sunyan
jianglei
输出
ligang
wangyan
zhouhong
huawen
sunyan
jianglei#$%^&*^&*jianglei后面这些是一些打不出的乱码,