Result: Accepted
Time: 1ms
Memory: 1092kB
#include<stdio.h>
#include<string.h>
void main()
{
char ch[200],k;
int n,m,p,q;
while(scanf("%s",&ch)!=EOF)
{
q=p=0;
n=strlen(ch);
if(n==1||n==2)
printf("zz happy!\n");
else if(n==3)
{
if(ch[0]==ch[2])
printf("zz happy!\n");
else
printf("zz cry\n");
}
else if(n>3){
for(m=0;m<n/2-1;m++)
{
if(ch[m]!=ch[n-m-2])
{
p=1;
break;
}
}
for(m=n-1;m>n/2;m--)
{
if(ch[m]!=ch[n-m])
{
q=1;
break;
}
}
if(p==1&&q==1)
printf("zz cry\n");
else
printf("zz happy!\n");
}
}
}