判断输入的字符串是否为回文
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
int i, j, n;
char s[100];
cin >> s;
n = strlen(s);
for (i = 0, j = n - 1; i <= n / 2; i++, j--)
{
if (s[i] != s[j]) break;
}
if (i >= j) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}