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

	#include<stdio.h>
#include<string.h>
int main(){
    char s[200];
    int i,a,k=0;
   while(scanf("%s",s)!=EOF){
        a=strlen(s);
	
        if(a%2==0)
        {
			for(i=a/2;i<a;i++)
        {
            if(s[i]!=s[a-i])
                { k=1;break;
            }
            if(i==a-1)
                {k=0;goto A;}}
			for(i=a/2-1;i<a;i++)
				{if(s[i]!=s[a-i-2])
			{k=1;
			
				break;}
				if(i==a-2)
				{k=0;goto A;}}
		
		}
        else if(a%2==1)
            {for(i=(a-1)/2;i<a;i++)
        {
            if(s[i]!=s[a-i])
                {k=1;break;}
             if(i==a-1)
                {k=0;goto A;}
            }
		for(i=(a-1)/2;i<a;i++)
		{
		
		if(s[i]!=s[a-i-2])
		{k=1;
			
				break;}}
		if(i==a-2)
		{k=0;break;}}


		if(a==1||a==2)
		{k=0;}
	A:	if(k==0)
			printf("zz happy!\n");
		if(k==1)
			printf("zz cry\n");}}