diff --git a/cmake-build-debug/.ninja_deps b/cmake-build-debug/.ninja_deps index 00cb88e..e734c58 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 0f488ae..4c53ebc 100644 --- a/cmake-build-debug/.ninja_log +++ b/cmake-build-debug/.ninja_log @@ -10,3 +10,27 @@ 15 23 1740403873708161538 Exercices 1155f81bcff01d1c 0 15 1740403932701569894 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 15 24 1740403932716569998 Exercices 1155f81bcff01d1c +1 15 1740404429522008915 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +15 23 1740404429536009012 Exercices 1155f81bcff01d1c +0 14 1740404434608044121 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +14 23 1740404434622044217 Exercices 1155f81bcff01d1c +1 14 1740404445731121115 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +14 23 1740404445744121205 Exercices 1155f81bcff01d1c +0 21 1740404452639168933 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +21 30 1740404452660169078 Exercices 1155f81bcff01d1c +0 15 1740404929887310942 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +15 23 1740404929902311036 Exercices 1155f81bcff01d1c +0 14 1740404945020405949 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +14 22 1740404945034406037 Exercices 1155f81bcff01d1c +1 16 1740405250012320715 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +16 32 1740405250027320809 Exercices 1155f81bcff01d1c +0 38 1740473535628230610 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +38 57 1740473535666230461 Exercices 1155f81bcff01d1c +0 18 1740473558635746608 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +18 26 1740473558653749514 Exercices 1155f81bcff01d1c +0 15 1740473607792717837 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +15 24 1740473607807717938 Exercices 1155f81bcff01d1c +1 15 1740473619845938424 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +15 24 1740473619860938858 Exercices 1155f81bcff01d1c +0 17 1740473682139410407 CMakeFiles/Exercices.dir/main.c.o 51f95a9f148558b3 +17 25 1740473682155410510 Exercices 1155f81bcff01d1c diff --git a/cmake-build-debug/CMakeFiles/Exercices.dir/main.c.o b/cmake-build-debug/CMakeFiles/Exercices.dir/main.c.o index f65e8ff..da12fa7 100644 Binary files a/cmake-build-debug/CMakeFiles/Exercices.dir/main.c.o and b/cmake-build-debug/CMakeFiles/Exercices.dir/main.c.o differ diff --git a/cmake-build-debug/Exercices b/cmake-build-debug/Exercices index 1e25eea..fbae272 100755 Binary files a/cmake-build-debug/Exercices and b/cmake-build-debug/Exercices differ diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index 9c413ac..624c831 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 14:32 CET +Start testing: Feb 25 09:54 CET ---------------------------------------------------------- -End testing: Feb 24 14:32 CET +End testing: Feb 25 09:54 CET diff --git a/main.c b/main.c index c9c2e85..0124d8d 100644 --- a/main.c +++ b/main.c @@ -49,9 +49,36 @@ bool dict_sort(int tab[], int cible) { } return trouve; } + +void insert(int tab[], int position, int element) { + int i = position; + while (i>0 && tab[i]>element) { + tab[i+1]=tab[i]; + i=i-1; + } + tab[i+1]=element; +} + +void sortinsert(int tab[]) { + int i; + for (i=2; i<=size; i++) { + insert(tab, i-1, tab[i]); + } +} + +int permutation(int tab[], int premier, int deuxieme) { + int temp; + + temp=tab[premier]; + tab[premier]=tab[deuxieme]; + tab[deuxieme]=temp; + printf("%d ",tab); + return tab; +} int main(void) { int* tab=alloc_tab(); - dict_sort(tab, 5); + //dict_sort(tab, 5); + sortinsert(tab); free(tab); return 0; -} \ No newline at end of file +}