Advertisement
sehe

Untitled

Dec 2nd, 2011
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <string>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.     const string s = "not a palindrome";
  8.     string::const_iterator f(s.begin()), l(f+s.size()/2);
  9.     string::const_reverse_iterator r(s.rbegin());
  10.  
  11.     return equal(f, l, r)? 1 : 0;
  12. }
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement