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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void)
{
  char a[201];
  int l,i,count1,count2,jd=1;
  while(scanf("%s",a)!=EOF)
  {
	  l=strlen(a);
	  if(l==0)
	  {
		  jd=0;
	  }
	  count1=0;
	  count2=0;
		  for(i=0;i<l-1;i++)
		  {
			  if(a[i]==a[l-2-i])
			  {
                  ++count1;
			  }
		  }
		  for(i=1;i<l;i++)
		  {
			  if(a[i]==a[l-i])
			  {
                  ++count2;
			  }
		  }
		  if(jd==1)
		  {
  if((count1==l-1)||(count2==l-1))
	 printf("zz happy!\n");
  else
     printf("zz cry\n");
		  }
  }
        return 0;
}