Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
348 B
0
Indexable
Never
#include <iostream>
using namespace std;

void palindr(string n) {
	string a = "";
	for (int i = n.size()-1;i >= 0;i--)
		a += n[i];
		if (a == n) {
			cout << "палиндром";
		}
		if (a != n) {
			cout << "не палиндром";
		}
	}

int main() {
	setlocale(LC_ALL, "Russian");
	string a;
	cin >> a;
	palindr(a);
}
Leave a Comment