From cb9cbfeba14ef6dbdf04d15030109169ea2d428c Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Tue, 4 Oct 2022 10:03:43 -0400 Subject: Fonction palindrome --- palindrome.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 palindrome.c diff --git a/palindrome.c b/palindrome.c new file mode 100644 index 0000000..0d467d5 --- /dev/null +++ b/palindrome.c @@ -0,0 +1,38 @@ +/* palindrome.c + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice + * you can do whatever you want with this stuff. If we meet some day, and you + * think this stuff is worth it, you can buy me a beer in return. + * Benjamin Chausse + * ---------------------------------------------------------------------------- + */ + +#include +#include "format.h" +#include "testData.h" + +int palindrome(char *s){ + int len = 0; + while (s[len]!= '\0'){ + len ++; + } + int j = len; + for (int i=0; i