This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int Fib( unsigned int n ) | |
{ | |
if( n == 0 ) return 0; | |
if( (n==1) || (n==2) ) return 1; | |
else return Fib(n-1)+Fib(n-2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isPalindrome( char *string, unsigned int l, unsigned int r ) | |
{ | |
if( l >= r )return true; | |
if( string[l] != string[r] ) return false; | |
return isPalindrome( string, l+1, r-1 ); | |
} |
NewerOlder