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

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