#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
string flipwords(string str) {
string rword = "";
vector<string> wrd;
for (int i = 0; i < str.length(); ++i)
wrd.push_back(str.substr(i,1));
reverse(str.begin(), str.end());
for (int = 0; i < str.size(); ++i)
rword += str[i];
return rword;
}
int main()
{
cout << "Enter a word: ";
string word;
cin >> word;
string rword = flipwords(word);
if (word == rword ) {
cout << "It's a palindrome.";
} else {
cout << "Not …Run Code Online (Sandbox Code Playgroud) c++ ×1