#include<stdio.h>#include<malloc.h>typedef char ElemType;typedef struct DNode{ ElemType data; struct DNode *prior; struct DNode *next;}DLinkNode;DLinkNode * CreateListR(){ DLinkNode *L; ElemType a; DLinkNode *s,*r; L=(DLinkNode *)malloc(sizeof(DLinkNode)); L->prior=L->next=NULL; r=L; printf("请依次输入数据,以0结束\n"); while(1) { scanf("%d",&a); s=(DLinkNode *)malloc(sizeof(DLinkNode)); if(a==0) break; else { s->data=a; r->next=s; s->prior=r; r=s; } } r->next=NULL; return L;}void reverse(DLinkNode *&L){ DLinkNode *p=L->next,*q; L->next=NULL; while(p->next!=NULL) { q=p->next; p->next=L->next; if(L->next!=NULL) { L->next->prior=p; } L->next=p; p->prior=L; p=q; }}void DispList(DLinkNode *L){ DLinkNode *p=L->next; while(p!=NULL) { printf("%c",p->data); p=p->next; } printf("\n");}int main(){ DLinkNode *s; s=CreateListR(); DispList(s); reverse(s); DispList(s); return 0; } 球球大佬看看咋老是乱码