Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <algorithm>
- using namespace std;
- int main()
- {
- const string s = "not a palindrome";
- string::const_iterator f(s.begin()), l(f+s.size()/2);
- string::const_reverse_iterator r(s.rbegin());
- return equal(f, l, r)? 1 : 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement