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: 2ms
Memory: 1700kB
Author: 2015210405001
In contest: 1043

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char s[205];
	int i,j,f;
	while(cin>>s)
	{
		for(f=1,i=0,j=strlen(s)-2;i<j;i++,j--)
			if(s[i]!=s[j])
				f=0;
		if(f){cout<<"zz happy!\n";continue;}
		for(f=1,i=1,j=strlen(s)-1;i<j;i++,j--)
			if(s[i]!=s[j])
				f=0;
		f?cout<<"zz happy!\n":cout<<"zz cry\n";
	}
}