I need help with this project, C++ functions.
#include <iostream> #include <string> using namespace std; bool isPalindrome(int x) { string palindrome; bool p =false; palindrome = (string) x; for(int i = 0; i < palindrome.length(); i++) { for(int j = palindrome.length(); j >=0; j--) { if((palindrome[i] == palindrome[j]) && i != palindrome.length() && j != 0) { continue; } if(i == palindrome.length() && j == 0) { return p = true; } else { return p; } } } } int main() { int n; cin >>n; if(isPalindrome(n)) { cout <<n<<" is a palindrome"; } else { cout << n<<" is NOT a palindrome"; } return 0; }