Home > Back-end >  Why do I list output not ah
Why do I list output not ah

Time:11-30

 # include  
# include
Typedef struct _node {
The int value.
Previous struct _node *;
Struct _node * next;
} the Node;
Int main (void) {
The head Node *=NULL;
Node * tail=NULL;
Int j=1;
For (int number; The scanf (" % d ", & number)==1 && number!=1) {
The Last Node *=head;
If (j==1) {
Head=(*) malloc (sizeof (Node));
The head -> value=https://bbs.csdn.net/topics/number;
The head -> next=NULL;
The head -> previous=NULL;
j++;
break;
}
The else {
for(; The Last; The Last of the Last=-> next);
Node * p=(*) malloc (sizeof (Node));
Last -> next=p;
P -> value=https://bbs.csdn.net/topics/number;
p->next=NULL;
P -> previous=Last;
Tail=p;
}
}
For (Node * I=head; i; I=I -> next) {
Printf (" % d \ t ", I -> value);
}
For (Node * k=tail; k; {k=k -> previous)
Printf (" % d \ t, k -> value);
}
return 0;
}
  • Related