#include <stdio.h>
int main()
{
int k, i;
char line[80];
printf(“Enter a string:”);
k = 0;
while (line[k] = getchar() != ‘n’)
k++;
line[k] = ‘ ’;
/判断字符串line是否为回文/
i = 0;
k = [k - 1];
while (i < k)
{
if (line[i] != line[k])
break;
i++;
k–;
}
if (i >= k)
printf(“It is a palindromen”);
else
printf(“It is not a palindromen”);
return 0;
}
最后
以上就是还单身早晨最近收集整理的关于/*判断字符串是否为回文*/的全部内容,更多相关/*判断字符串是否为回文*/内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复