若一个字符串的正序与倒序相同,则称其为回文字符串。
代码如下:
#define m 100
typedef struct zhan //定义栈
{
char data[m];
int top;
}zhan;
typedef struct dui{ //定义队列
char data[m];
int front;
int rear;
}dui;
# include "StructDefine.h"
void cshz(zhan *s); //初始化栈
int pdzk(zhan *s) ; //判断栈是否为空
void ruzhan(zhan *s,char x); //入栈
char chuzhan(zhan *s) ; //出栈
void cshdl(dui *q); //初始化队列
void rudui(dui *q,char e); //入队
char chudui(dui *q) ; //出队
void panduan(zhan *s,dui *q); //判断
# include <iostream>
# include "StructDefine.h"
# include <malloc.h>
using namespace std;
void cshz(zhan *s) //初始化栈
{
s->top=0;
}
int pdzk(zhan *s)