#include <iostream>
#include <Windows.h>
#include <string> // Behövs för klassen string (se avsnitt 9.2).

using namespace std;

bool palindrom(string text) { // Definition av funktionen palindrom.
	unsigned int första = 0, sista = text.size() - 1; // Lokala variabler.
	while (första < sista)
		if (text[första++] != text[sista--])
		return false;
	return true;
}

int main()
{
	SetConsoleCP(1252);
	SetConsoleOutputCP(1252);
	string t;
	cout << "Skriv en text: ";
	cin >> t;
	if (palindrom(t)) // Anrop av funktionen palindrom.
		cout << t << " är en palindrom!" << endl;
	else
		cout << t << " är inte en palindrom." << endl;
	return 0;
}