您的位置:首页 > 其它

参考别人编写的判断回文字符

2010-11-26 20:57 197 查看
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#define N 50

int cycle(char *s)

{

char *a,*b;

for(a=s,b=s+strlen(s)-1; b>a ;a++,b--)

{

if(*a!=*b)

{

break;

}

}

return b<=a;

};

int main()

{

char m
;

int t;

scanf("%s",m);

if(cycle(m))

printf("%s is cycle string/n",m);

else

printf("s is not cycle string/n");

return 0;

};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: