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

#include<stdio.h>
#include<string.h>
int main()
{
	char a[200];
	int i,j,len;
	int count1,count2;
	 while(scanf("%s",a)==1)
	 {
		 len=strlen(a);
		 count1=0;
		 count2=0;
		 for(i=1,j=len-1;i<len/2.0;++i,j--)
		 {
			 if(a[i]==a[j])
				 ++count1;
			
		 }
		  for(i=0,j=len-2;i<(len-2)/2.0;++i,j--)
		 {

			 if(a[i]==a[j])
				 ++count2;

		 }
		  if(len%2==0)
		  {
			  if(count1==(len-2)/2||count2==(len-2)/2)
				   printf("zz happy!\n");
		      else 
			       printf("zz cry\n");
		  }
		  else if(len%2!=0)
		  {
			  if(count1==(len-1)/2||count2==(len-1)/2)
				   printf("zz happy!\n");
		      else 
			       printf("zz cry\n");
		  }

	 }

}