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: 2015210405025
In contest: 1043

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