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

#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdio>
#include<cmath>
#include<map>
#include<vector>
#include<iomanip>
using namespace std;
int main(void)
{
	char s[2000];
	while(cin>>s)
	{
		int l,i,j,sum,q=0;
		l=strlen(s);
		sum=0;
		for(i=0;i<l-1;++i)
		{
			if(s[i]==s[l-i-2])
				sum++;
		}
		if(sum==l-1)q=1;
		sum=0;
		for(i=1;i<l;++i)
		{
			if(s[i]==s[l-i])
				sum++;
		}
		if(sum==l-1)q=1;
		if(q)cout<<"zz happy!"<<endl;
		else cout<<"zz cry"<<endl;
	}
	return 0;
}