RosettaCodeData/Task/Palindrome-detection/C/palindrome-detection-3.c
Ingy döt Net 776bba907c Sync
2013-10-27 22:24:23 +00:00

6 lines
155 B
C

int palindrome_r(const char *s, int b, int e)
{
if ( (e - 1) <= b ) return 1;
if ( s[b] != s[e-1] ) return 0;
return palindrome_r(s, b+1, e-1);
}