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

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