Start: Dec, 27, 2015 17:15:00
2015年秋学期《程序设计基础》第三次上机考试
End: Dec, 27, 2015 20:45:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 1ms
Memory: 1092kB
Author: 2015210405016
In contest: 1043

#include<stdio.h>
#include<string.h>
int main()
{
    int t,i,n;
    char s[203];
    while(~scanf("%s",s))
    {
        n=strlen(s);
        if(n == 2 || n == 1)
            printf("zz happy!\n");
        else
        {
            for(i=0;i < n / 2;i++)
            {
                if(s[i] != s[n-2-i])
                    break;
            }
            if(s[i] == s[n - 2 - i])
                printf("zz happy!\n");
            else
            {
                for(i = 1;i <= n / 2;i++)
                {
                    if(s[i] != s[n-i])
                        break;
                }
                if(s[i] == s[n-i])
                    printf("zz happy!\n");
                else
                    printf("zz cry\n");
        }
        }
    }
    return 0;
}