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

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