#include <iostream>
#include <string.h>
#include <malloc.h>
using namespace std;
typedef struct DNode
{
char str;
struct DNode *prior;
struct DNode *next;
}DLinkList;
DLinkList * DInitList()
{
DLinkList *L;
L = (DLinkList *)malloc(sizeof(DLinkList));
L->prior = NULL;
L->next = NULL;
return L;
}
void DListInsert(DLinkList *L,char e)
{
DLinkList *p=L,*s;
while(p->next != NULL)
p = p->next;
s = (DLinkList *)malloc(sizeof(DLinkList));
s->next = NULL;
s->str = e;
p->next = s;
s->prior = p;
}
main()
{
char e;
DLinkList *t,*x,*y;
t = DInitList();
e = getchar();
while(e != '/n')
{
DListInsert(t,e);
e = getchar();
}
x = t;
if(x->next != NULL)
x = x->next;
else
cout<<"error!"<<endl;
while(x->next != NULL)
x = x->next;
y = x;
x = t->next;
while(x->str == y->str && x->next !=NULL)
{
x = x->next;
y = y->prior;
}
if(x->next == NULL)
cout<<"是回文"<<endl;
else
cout<<"不是回文"<<endl;
}