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

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