#include <string>
#include <iostream>

bool palindrome( const std::string& s, int i = 0 )
{
    if ( i == s.size() )
        return true;

    return s[ i ] == s[ s.size() - i - 1 ] && palindrome( s , i + 1 );
}

int main()
{
    using namespace std;
    cout << palindrome( "example" ) << endl; // Not palindrome
    cout << palindrome( "repaper" ) << endl; // Palindrome
    cout << palindrome( "rotator" ) << endl; // Palindrome
    cout << palindrome( "madam" ) << endl; // Palindrome
    cout << palindrome( "" ) << endl; // Palindrome
    cout << palindrome( "" ) << endl; // Palindrome
}
