Palindrome
Palindrome
Return 1 if a C-string reads the same in both directions, otherwise 0 — in C there's no bool by default, so we use the integers 1 and 0. Compare characters from the two ends moving inward.
Palindrome
Retournez 1 si une chaîne C se lit pareillement dans les deux sens, sinon 0 — en C il n'y a pas de bool par défaut, donc nous utilisons les entiers 1 et 0. Comparez les caractères des deux extrémités en allant vers l'intérieur.
Complete int is_palindrome(const char *s) to return 1 if · si s reads the same forwards and backwards, otherwise 0. · Complétez int is_palindrome(const char *s) pour retourner 1 si s se lit de la même façon vers l'avant et vers l'arrière, sinon 0.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.