Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool testPalindrome(const string & str)
- {
- int i=0;
- int j=0;
- bool ok=true;
- i=chaine.size() - 1;
- while (j <= i && ok)
- {
- if (chaine[i] == chaine[j])
- {
- i--;
- j++;
- }
- else
- {
- ok = false;
- }
- }
- if (ok)
- {
- return true;
- }
- else
- {
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement