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 plaindrome\n");
        else
            printf("It is not aplalindrome\n");
        return 0;
}

posted @ 2013-10-08 01:24  傻子疯子捏子  阅读(89)  评论(0编辑  收藏  举报