![[太开心]](/static/emoticons/u592au5f00u5fc3.png)
借楼插个缝,
#include<stdio.h>
#include<stdlib.h>
struct S
{
struct S *last;
int data;
struct S *next;
};
int create()
{
struct S *head;
struct S *p1, *p2;
p1 = (struct S *)malloc(sizeof(struct S));
head = p1;
p1->last = NULL;
scanf("%d", &p1->data);
while (p1->data != 90)
{
p2 = (struct S *)malloc(sizeof(struct S));
p1->next = p2;
p2->last = p1;
p1 = p2;
scanf("%d", &p1->data);
}
p1->next = NULL;
return head;
}
int main()
{
struct S *p;
p = create();
while (p->next != NULL)
{
printf("%d ", p->data);
p = p->next;
}
p=p->last;
do
{
printf("%d ", p->data);
p = p->last;
}
while (p -> last != NULL)
}
![[喷]](/static/emoticons/u55b7.png)
为什么运行不了
![[不高兴]](/static/emoticons/u4e0du9ad8u5174.png)
