#include #include "stack.h" int main(void) { ElemType ch,a1,a2; Stack s,p; int size = 0; bool flag = false; InitStack(&s); InitStack(&p); while ((ch = getchar()) != '\n') { Push(&s,tolower(ch)); size++; } if (size == 0) return 0; if (size % 2 == 0) flag = true; size /= 2; if (!flag) size++; for (int i = 0; i < size; i++) { if (flag) { Pop(&s,&ch); Push(&p,ch); } else { if (i == size - 1) ch = GetTop(&s); else Pop(&s,&ch); Push(&p,ch); } } while (s) { Pop(&s,&a1); Pop(&p,&a2); if (a1 != a2) break; } if (s) { printf("Not palindrome word!\n"); DestroyStack(&s); DestroyStack(&p); } else printf("Is palindrome word!\n"); return 0; }