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

#include<stdio.h>
#include<string.h>
int main(){
	int l,i,k=0,m=0,t;
	 char a[202];
	 char c[202];
	 while(scanf("%s",a)!=EOF)
		
    {    k=0;m=0;t=0;
	 
		l=strlen(a);
		 for(i=0;i<l;i++)
		 { c[l-i-1]=a[i];
		 }
		a[l]=a[0];
		a[l+1]='\0';
	    for(i=0;i<(l+1)/2;i++)
	   {
	   if(a[i]==a[l-i])
		k++;
	
	
	
	   }
	 

	      if(k==(l+1)/2)
		   {t++; printf("zz happy!\n");}
	   
		  if(t==0)
		  {
		  
		  c[l]=c[0];
		  c[l+1]='\0';
	    for(i=0;i<(l+1)/2;i++)
	     {
	   if(c[i]==c[l-i])
		m++;
		}
		  
		  
		  
		  if(m==(l+1)/2)

		  {t++; printf("zz happy!\n");}
		  
		  
		  }


	 

	    
	 if(t==0) printf("zz cry\n");
	 
	 
	 }
}