Untitled
unknown
plain_text
a year ago
421 B
3
Indexable
#include <iostream>
#include <string>
using namespace std;
boool isPalindrome(string &str, int start, int end) {
if (start >= end) return true;
if (str[start] != str[end]) return false;
return isPalidrome(str, start + 1, end - 1);
}
int main() {
int n;
cin >> n;
string str = to_strin(n);
if (isPalidrome(str, 0, str.length() - 1))
cout << "Palidrome" << endl;
else
}
return 0;
}Editor is loading...
Leave a Comment