编辑代码

#include <stdio.h>
#include <stdbool.h>
#include <string.h>

bool isPalindromeRecursive(char str[], int start, int end) {
    if (start >= end) {
        return true;
    }
    if (str[start] != str[end]) {
        return false;
    }
    return isPalindromeRecursive(str, start + 1, end - 1);
}

int main() {
    char str[] = "aaabaaa";
    if (isPalindromeRecursive(str, 0, strlen(str) - 1)) {
        printf("是");
    } else {
        printf("不是");
    }
    return 0;
}