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

#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<string.h>
using namespace std;
int main()
{
	char a[201];
	int x,y,i,j,jd,jd1;
	while(scanf("%s",a)!=EOF)
	{
		jd=1;
		jd1=1;
		getchar();
		for(i=0;i<strlen(a)/2;i++)
		{
			//printf("%c %c\n",a[i+1],a[strlen(a)-1-i]);
			if(a[i+1]!=a[strlen(a)-1-i])
			{
				jd=0;
			    //printf("%c %c\n",a[i+1],a[strlen(a)-1-i]);
			}
		}
		for(i=0;i<strlen(a)/2;i++)
		{
			//printf("%c %c\n",a[i],a[strlen(a)-2-i]);
			if(a[i]!=a[strlen(a)-2-i])
				jd1=0;
		}
		//printf("%d %d\n",jd,jd1);
		if(jd||jd1)
			printf("zz happy!\n");
		else
			printf("zz cry\n");
	}
}