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

#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
	char s[210],sh[210],se[210];
	while(scanf("%s",s)!=EOF)
	{
		sh[0]=s[strlen(s)-1];
		int i,j,k,re=1;
		for(i=1,j=0;j<strlen(s);i++,j++)
			sh[i]=s[j];
		sh[i]='\0';
		for(i=0;i<strlen(sh)/2;i++)
		{
			if(sh[i]!=sh[strlen(sh)-i-1])
			{
				re=0;
				break;
			}
		}
		if(re==0)
		{
			re=1;
			for(i=0;i<strlen(s);i++)
				se[i]=s[i];
			se[i]=s[0];
			se[i+1]='\0';
			for(i=0;i<strlen(se)/2;i++)
			{
				if(se[i]!=se[strlen(se)-i-1])
				{
					re=0;
					break;
				}
			}
		}
		if(re==0)
			printf("zz cry\n");
		if(re==1)
			printf("zz happy!\n");
	}
}