想用以下程序判断字符串是不是回文,我已经快炸了,来求助了
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define N 1000
#define true 1
#define false 0
typedef int Bool;
Bool is_palindrome(const char *message);
int main(void)
{
char array[N],array1[N],*p,*q;
int flag;
printf("Enter the passage:");
gets(array);
for(p=array,q=array1;p<array+N,q<array1+N;p++)
if(toupper(*p) >= 'A' && toupper(*p)<= 'Z'){
*q=toupper(*p);
q++;
}
flag=is_palindrome(array1);
if(flag)
printf("Palindrome\n");
else
printf("Not a palindrome\n");
return 0;
}
Bool is_palindrome(const char *message)
{
int i;
char *p,*q;
i=strlen(message);
p = message;
q = message + i;
while(p<=q)
if(*p++ != *q--)
return false;
return true;
}