Result: Accepted
Time: 1ms
Memory: 1092kB
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<string.h>
using namespace std;
int main()
{
char a[201];
int x,y,i,j,jd,jd1;
while(scanf("%s",a)!=EOF)
{
jd=1;
jd1=1;
getchar();
for(i=0;i<strlen(a)/2;i++)
{
//printf("%c %c\n",a[i+1],a[strlen(a)-1-i]);
if(a[i+1]!=a[strlen(a)-1-i])
{
jd=0;
//printf("%c %c\n",a[i+1],a[strlen(a)-1-i]);
}
}
for(i=0;i<strlen(a)/2;i++)
{
//printf("%c %c\n",a[i],a[strlen(a)-2-i]);
if(a[i]!=a[strlen(a)-2-i])
jd1=0;
}
//printf("%d %d\n",jd,jd1);
if(jd||jd1)
printf("zz happy!\n");
else
printf("zz cry\n");
}
}