Untitled
unknown
plain_text
2 years ago
460 B
1
Indexable
#include <iostream> #include <string> using namespace std; int main() { string s, a , b; int c = 0; cin >> s; int n = s.length(); for (int i = 1; (i - 1) < n; i++) { if (s[i - 1] == s[s.length() - i]) { c++; } else { cout << "NO"; return 0; } } if (c == n) { cout << "YES"; } }
Editor is loading...