Untitled
Anonymous
plain_text
11/17/2022 6:14 PM
616 B
15
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...