#include#include struct node { char c[100]; struct node *next;};typedef struct node Node;typedef struct node *pNode;pNode INIT();pNode VISIT(pNode s, pNode f);pNode BACK(pNode s, pNode f);pNode FORWARD(pNode s, pNode f);pNode QUIT(pNode s);pNode Te(pNode s);pNode INIT() { pNode s = (pNode)malloc(sizeof(Node)); if (s == NULL ) { printf("memery failed"); return NULL; } s->next= NULL; printf("init success\n"); return s; }pNode VISIT(pNode s, pNode f){ pNode p = (pNode)malloc(sizeof(Node)); pNode tmp = s->next; if (f != s) { while (tmp != f) { s->next = tmp->next; free(tmp); } } if (p == NULL ) { printf("memery failure\n"); return NULL; } scanf("%s", p->c); p->next = s->next; s->next= p; return p;}pNode BACK(pNode s, pNode f){ return f->next;}pNode FORWARD(pNode s, pNode f){ pNode Tmp = s->next; if (Tmp->next != f) { Tmp = Tmp->next; } return Tmp;}pNode Te(pNode s) { pNode p = s->next; if (p == NULL) { printf("empty"); } while (p!=NULL) { printf("%s\n",p->c); p = p->next; } return s;} int main(){ int T, i; char a[10]; pNode s, f ;/* scanf("%d", &T); printf("%d\n", T); */ while(scanf("%d", &T) == 1) { s = INIT(); f = s; f = VISIT(s, f); f = VISIT(s, f); s = Te(s) ; } return 0;}