csansoon

P7.04 P50497 Is it a palindrome?

Nov 12th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. bool is_palindrome(const string& s) {
  6.     for (int i=0; i< (s.size()/2); i++) if (s[i] != s[s.size()-1-i]) return false;
  7.     return true;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment