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

#include<stdio.h>
#include<string.h>
int main()
{
	char str[200];
	int length;
	while(scanf("%s",str)!=EOF)
	{
		int i,j,a,b;
		length=strlen(str);
		for(i=1;i<=length-1;i++)
		{
			if((int)str[i]!=(int)str[length-i])
				break;
		}
		if(i==length)
			a=1;
		else
			a=0;
		for(j=0;j<=length-2;j++)
		{
			if((int)str[j]!=(int)str[length-2-j])
				break;
		}
		if(j==length-1)
			b=1;
		else
			b=0;
		if(a==1||b==1)
			printf("zz happy!\n");
		else
			printf("zz cry\n");
	}
}