#include <bits/stdc++.h>
using namespace std;
#define Maxsize 50
typedef int ElemType;
typedef struct
{
ElemType data[Maxsize];
int top;
}SqStack;
//初始化
void InitStack(SqStack &S)
{
S.top=-1;
}
//判栈是否为空
bool StackEmpty(SqStack S)
{
return S.top==-1;
}
//进栈
bool Push(SqStack &S,ElemType x)
{
if(S.top==Maxsize-1)
return false;
S.data[++S.top]=x;
return true;
}
//出栈
bool Pop(SqStack &S,ElemType &x)
{
if(S.top==-1)
return false;
x=S.data[S.top--];
return true;
}
//读取栈顶元素
bool GetTop(SqStack S,ElemType &x)
{
if(S.top==-1)
return false;
x=S.data[S.top];
return true;
}
//应用题3-2判断一个序列是否合法
bool judge(char s[])
{
int cnt=0;
for(int i=0;i<strlen(s);i++)
{
if(s[i]='I')
cnt++;
else if(s[i]=='O')
cnt--;
if(cnt<0)
return false;
}
if(cnt)
return false;
return true;
}
//判断是否是中心对称
bool dc(LinkList *L,int n)
{
//char *s;
//s=(char *)malloc(sizeof(char)*n/2);
char s[n/2];//怀疑答案这样写是不是不好
LNode *p=L->next;
for(int i=0;i<n/2;i++)
{
s[i]=p->data;
p=p->next;
}
if(n%2)
p=p->next;
int j=n/2-1;
while(p!=NULL&&s[j]==p->data)
{
j--;
p=p->next;
}
if(j==-1)
return true;
return false;
}
int main()
{
return 0;
}