#include<stdio.h>
void main()
{
int i,light=0;
char s1[100],s2[100];
gets(s1);///we
strcpy(s2,s1);
strrev(s2);///s2=ew
if(strlen(s1)!=strlen(s2))
printf("not palindrome \n");
else
{
for(i=0;s1[i]!=NULL;i++)
{
if(s1[i]!=s2[i])
{
light=1;
break;
}
}
if(light==1) printf("not palindrome");
else if(light==0)printf("palindrome");
}
}
No comments:
Post a Comment