C++ 没有与这些操作数匹配的 运算符 操作数类型为: std::basic_istream<char, std::char_traits> != int
#include <iostream>
#include <cstring>
char m[9];
int main() {
while (std::cin >> m != EOF) {
int flag = 1;
for (int i = 0, len = strlen(m); i < len / 2; i++) {
std::cout << m[0];
if (m[i] != m[len - 1 - i]) {
flag = 0;
break;
}
}
std::cout << flag ? "YES" : "NO";
}
return 0;
}