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: 1104kB
Author: 2015210402051
In contest: 1043

#include<stdio.h>
#include<string.h>
main()
{
	char in[202],chin[202],nu[202];
	int i,j,x;
	while (scanf("%s",in)!=EOF)
	{
		x=0;
		//*****前端加大写
		for (i=65;i<91;i++)
		{
			chin[0]=i;
			chin[1]='\0';
			strcpy(nu,in);

			strcpy(nu,strcat(chin,in));
			for (j=0;j<strlen(nu)/2;j++)
			{
				if (nu[j]!=nu[strlen(nu)-1-j])
					break;

			}
			
		
		if (j==(strlen(nu))/2)
		{
			printf("zz happy!\n");
			x=1;
			break;
		}
       }
		if (x==1)
			continue;
		//*****末端加大写
		for (i=65;i<91;i++)
		{
			chin[0]=i;
			chin[1]='\0';
			strcpy(nu,in);

			strcat(nu,chin);
			for (j=0;j<strlen(nu)/2;j++)
			{
				if (nu[j]!=nu[strlen(nu)-1-j])
					break;

			}
			
		
		if (j==(strlen(nu))/2)
		{
			printf("zz happy!\n");
			x=1;
			break;
		}
		}
		if (x==1)
			continue;
		//*****前端加小写
		for (i=97;i<123;i++)
		{
			chin[0]=i;
			chin[1]='\0';
			strcpy(nu,in);

			strcpy(nu,strcat(chin,in));
			for (j=0;j<strlen(nu)/2;j++)
			{
				if (nu[j]!=nu[strlen(nu)-1-j])
					break;

			}
			
		
		if (j==(strlen(nu))/2)
		{
			printf("zz happy!\n");
			x=1;
			break;
		}
		}
		if (x==1)
			continue;
		//*****末端加小写
			for (i=97;i<123;i++)
		{
			chin[0]=i;
			chin[1]='\0';
			strcpy(nu,in);

			strcat(nu,chin);
			for (j=0;j<strlen(nu)/2;j++)
			{
				if (nu[j]!=nu[strlen(nu)-1-j])
					break;

			}
			
		
		if (j==(strlen(nu))/2)
		{
			printf("zz happy!\n");
			x=1;
			break;
		}
		}
		if (x==0)
		printf("zz cry\n");
	}
}