#include <iostream>
using namespace std;

// words with odd lengths are often palindromes
// check first and last characters, then move inward
string checkIfPalindrome(string str) {
    int left = 0;
    int right = str.length() - 1;

    while (left < right) {
        if (str[left] != str[right]) {
            cout << str << " is not a palindrome." << endl;
            return "";
        }
        left++;
        right--;
    }
    cout << str << " is a palindrome." << endl;
    return "";

};

int main() {
    std::string input;
    std::cout << "Enter a string to check if it's a palindrome (or 'quit' to exit): ";
    std::cin >> input;
    checkIfPalindrome(input);
};