Code: Select all
#include <stdio.h>
#include <string.h>
#include <ctype.h>
char s[1000]; /// I tried here even 1000000, but still WA
int i,j;
int main(void)
{
while(gets(s), strcmp(s,"DONE"))
{
i = j = 0;
while(s[++i])
if (isalpha(s[i])) s[++j] = s[i];
for(i=0;i<j;i++,j--)
if (tolower(s[i]) != tolower(s[j])) break;
if (i>=j) printf("You won't be eaten!\n");
else printf("Uh oh..\n");
}
return 0;
}