7-11

#include<stdio.h>

int main(void)

{

         int i,n,m;

         char s[10];

 

         printf("Enter a string:");

         i=0;

         while((s[i]=getchar())!='\n')

                   i++;

         s[i]='\0';

 

         for(n=0,m=i-1;n<m;n++,m--)

                   if(s[n]!=s[m])

                            break;

                   if(n>=m)

                            printf("It is a plalindrome\n");

                   else

                            printf("It is not a plalindrome\n");

 

                   return 0;

}

 

posted @ 2013-10-06 15:37  zhaoyang16  阅读(100)  评论(0编辑  收藏  举报