#include <iostream>
#include <string>
#include <stdio.h>
bool isPalindrom(std::string str) {
std::string cop = "";
for (int i = str.size() - 1; i >= 0; --i) {
cop += str[i];
}
return (cop == str);
}
int main() {
if (isPalindrom("heheheheheheheheh")) {
printf("Yes");
} else {
printf("No");
}
return 0;
}
а зачем копировать стрингу, если можно сравнивать первый и последний элемент, потом 2 и предпоследний, и так далее?