SHARE
TWEET

Палиндром

Courbe_Impliquee Apr 20th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5. int main() {
  6.     int l;
  7.     bool flag=1;
  8.     string s;
  9.     cin>>s;
  10.     l = s.size();
  11.     for (int i = 0,j= l-1; i < l/2; i++,j--) {
  12.             if (s[i] != s[j])
  13.                 flag = 0;
  14.     }
  15.     if (flag) cout << "yes";
  16.     else cout << "no";
  17.     system("pause");
  18.     return 0;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top