Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
298 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s;
	cin >> s; 
	int lol = s.length() - 1;
	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] != s[lol]) {
			cout << "NO";
			break;
		}
		lol -= 1;
		if (lol == -1) {
			cout << "YES";
		}
		
	}
}
Leave a Comment