vendredi 12 novembre 2021

how to solve a palindrome in a simple way more than using it as string? [closed]

#include <iostream>

using namespace std;

int main() {

string N;
cin >> N;
if (N[0] == N[3] && N[1] == N[2])
    cout << "yes";
else
    cout << "no";

}

Aucun commentaire:

Enregistrer un commentaire