Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = len(s)
- if n <= 1:
- return True
- else:
- return (s[0] == s[n - 1]) and is_palindrome(s[1:n - 1])
- string s;
- cin>>s;
- cout<<testPalindrom(s);
- return 0;
- int n=s.length();
- if (n<=1)
- return true;
- else
- return (s[0] == s[n-1]) && testPalindrom(s.substr(1,n-1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement