Advertisement
Alexandre_lsv

Untitled

Mar 14th, 2016
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. bool comp(string s){
  5.     for (ll i=0; i<(s.length()+1)/2; i++){
  6.         if (s[i]!=s[s.length()-i-1])
  7.             return false;
  8.     }
  9.     return true;
  10. }
  11. int main(){
  12.     string s;
  13.     cin.sync_with_stdio(false);
  14.     cin >> s;
  15.     cout << (comp(s)?"yes":"no") << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement