diff --git a/cmake-build-debug/.ninja_deps b/cmake-build-debug/.ninja_deps index ab92083..b9347fd 100644 Binary files a/cmake-build-debug/.ninja_deps and b/cmake-build-debug/.ninja_deps differ diff --git a/cmake-build-debug/.ninja_log b/cmake-build-debug/.ninja_log index 0e4d746..d0cd88e 100644 --- a/cmake-build-debug/.ninja_log +++ b/cmake-build-debug/.ninja_log @@ -1,21 +1,5 @@ # ninja log v6 1 9 1740394573852693968 CMakeFiles/Exercices.dir/Exercice2.c.o 8abbf7ed2ff63668 -14 23 1740399424068673015 Exercices f05032c4fac3334d -0 14 1740399424054672910 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -0 9 1740399723326817334 build.ninja 2e74603cecdb425f -0 14 1740399723328817343 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -14 23 1740399723342817403 Exercices 1155f81bcff01d1c -0 13 1740399750185932613 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -13 26 1740399750198932669 Exercices 1155f81bcff01d1c -1 14 1740399762272984410 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -14 22 1740399762285984465 Exercices 1155f81bcff01d1c -0 17 1740399869408438810 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -17 26 1740399869424438878 Exercices 1155f81bcff01d1c -0 14 1740399877033471575 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -14 23 1740399877047471635 Exercices 1155f81bcff01d1c -1 17 1740399893282541545 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -17 32 1740399893298541615 Exercices 1155f81bcff01d1c -0 14 1740399931349708754 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 -14 22 1740399931363708815 Exercices 1155f81bcff01d1c -0 16 1740399978792913976 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 16 25 1740399978808914044 Exercices 1155f81bcff01d1c +0 16 1740399978792913976 CMakeFiles/Exercices.dir/main.c.o 30c179a7aefe8551 +0 9 1740400419048998063 build.ninja 2e74603cecdb425f diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index 86913aa..5fee919 100644 --- a/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/cmake-build-debug/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Feb 24 13:26 CET +Start testing: Feb 24 13:33 CET ---------------------------------------------------------- -End testing: Feb 24 13:26 CET +End testing: Feb 24 13:33 CET diff --git a/main.c b/main.c index 4b30fd7..8ecfbed 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,5 @@ +#include +#include #include #include @@ -17,8 +19,19 @@ int *alloc_tab(){ return tab; } -void in_tab(int tab[], int cible) { - int occurence=0; +bool dict_sort(int tab[], int cible) { + // Définition et Assignation des variables + int pointer = 1; + int intervale= size; + int pivot; + bool trouve=false; + + while (trouve==false and pointer<=intervale) { + pivot = (pointer+intervale)/2; + if (tab[pivot]> + } + + for (int i=0; i < size; i++) { if (tab[i] == cible) { printf("La cible se trouve dans le tableau\n"); @@ -34,7 +47,7 @@ void in_tab(int tab[], int cible) { } int main(void) { int* tab=alloc_tab(); - in_tab(tab, 5); + dict_sort(tab, 5); free(tab); return 0; } \ No newline at end of file