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

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