Advertisement
Courbe_Impliquee

Палиндром

Apr 20th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement