a84c08f3c0ef0b50b0a6701d4ff0aaea627099a9
8 bool palindrome_iter(char* mot
, int longeur
) {
13 if (mot
[i
] != mot
[j
]) { return false; }
20 bool palindrome_rec_aux(char* mot
, int i
, int j
) {
21 if (i
>= j
) { return true; }
22 if (mot
[i
] != mot
[j
]) { return false; }
23 return palindrome_rec_aux(mot
, i
+1, j
-1);
26 bool palindrome_rec(char* mot
, int longueur
) {
27 return palindrome_rec_aux(mot
, 0, longueur
-1);
34 printf("Saisir un mot\n");
36 if (palindrome_rec(mot
, strlen(mot
)))
37 printf("%s est un palindrome\n", mot
);
39 printf("%s n'est pas un palindrome\n", mot
);