#include <stdio.h>
#include <assert.h>
int panduan( char *p )
{
char *q ;
assert( *p != NULL );
q = p;
while( *p != '\0')
{
p++;
}
p--;
while(*q != '\0')
{
if( *p == *q)
{
p--;
q++;
}
else
return -1;
}
return 1;
}
int main()
{
char p[] = "12321";
printf("%d\n",panduan(p));
return 0;
}
0 0
网友评论