相关代码 |
|
#include "d:\cpp\ql.cpp" #include "d:\cpp\ss.cpp" Bool huiwen(char con[]){ SqStack S; LinkQueue Q; ElemType e1,e2; int i; i=0; InitStack(S); InitQueue(Q); while(con[i]!='\0'){ Push(S,con[i]); EnQueue(Q,con[i]); i++; }//while while(DeQueue(Q,e1)){ Pop(S,e2); if(e1!=e2)break; }//while if(!QueueEmpty(Q)) return FALSE; else return TRUE; } main(){ char con[]="asfdsbafdsadssa"; printf("zi fu chuan %s ",con); if(huiwen(con)==TRUE) printf("YES\n"); else printf("NO\n"); }
相关资源 |
|