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

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