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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int  fun( char str[] )
{ 
	int   i,j,n;
	n=strlen(str);
	n=n+1;
	for(i=1,j=n-2;i<=(n-1)/2;i++,j--)
		if(str[i]!=str[j])  break;
	if(i<=j)
	{
	for(i=0,j=n-3;i<=(n-1)/2;i++,j--)
		if(str[i]!=str[j])  break;
	}
	if(i>j) return 1;
	return 0;

}
int main()
{
	char a[203];
	while(scanf("%s",&a)!=EOF)
	{

		if  ( fun(a)==1 )   
			printf( "zz happy!\n"); 
		else  printf("zz cry\n");
	}
}