//polidrom ! abbCbba ? #include "stack.h" void main() { booly flag=True; int i; char ch,st[20]="abbcbba"; stack s; init(&s); printf("string:"); puts(st); // gets(st); for (i=0; st[i] != 'c' ;i++) { printf("Pushing %c\n",st[i]); push(&s,st[i]); } i++; //עובר את הC while (st[i]!='\0') { pop(&s,&ch); if (st[i]!=ch) { printf("%c = %c\n",st[i],ch); flag=False; } i++; } puts(""); (flag)?printf("good polidrom!"):printf("bad polidrom!"); }