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: 1700kB
Author: 2015210402108
In contest: 1043

#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
	string s;
	int i,x=0;
	while(cin>>s)
	{
		x=0;
		for(i=1;i<(s.size()+1)/2;++i)
		{
			if(s[i]!=s[s.size()-i])
			{
				break;
			}
		}
		if(i==(s.size()+1)/2)
			x=1;
		for(i=0;i<(s.size()+1)/2;++i)
		{
			if(s[i]!=s[s.size()-2-i])
			{
				break;
			}
		}
		if(i==(s.size()+1)/2)
			x=1;
		if(x==0)
			cout<<"zz cry"<<'\n';
		else
			cout<<"zz happy!"<<'\n';
	}
}