#include#include #include int is_pal_str(const char *p){ assert(p); int len = strlen(p); const char *start = p; const char *end = p+len - 1; while (start < end) { if (*start == *end) { start++; end--; } else { return 0; } } return 1;}int main(){ char *p = "abcdcbaa"; int ret = is_pal_str(p); if (ret == 1) { printf("%s 是一个回文字符串\n", p); } else { printf("%s 不是一个回文字符串\n", p); } system("pause"); return 0;}