Skip to content
Snippets Groups Projects
Commit abc4e270 authored by malric litiere's avatar malric litiere
Browse files

avant pull

parent e1ef5fe3
No related merge requests found
No preview for this file type
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
int main() { int main() {
int T1[5] ={3,2,5,1,4} ; long T1[5] ={3,2,5,1,4} ;
int T2[8] ={3,2,8,4,1,6,7,5} ; long T2[8] ={3,2,8,4,1,6,7,5} ;
affichertab(T1,5); affichertab(T1,5);
printf("\n"); printf("\n");
......
No preview for this file type
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
void triInsertion(int* A, int n){ void triInsertion(long* A, size_t n){
for(int i = 1; i <= n-1; i++){ for(size_t i = 1; i <= n-1; i++){
int cle = A[i]; long cle = A[i];
int j = i - 1; size_t j = i - 1;
while(j >= 0 && A[j] > cle){ while(j+1 >= j && A[j] > cle){
A[j+1] = A[j]; A[j+1] = A[j];
j--; j = j-1;
} }
A[j+1] = cle; A[j+1] = cle;
} }
......
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
void triInsertion(int* A, int n); void triInsertion(long* A, size_t n);
\ No newline at end of file \ No newline at end of file
No preview for this file type
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "utils.h" #include "utils.h"
void affichertab(int* T, int s){ void affichertab(long* T, int s){
for(int i = 0; i < s; i++){ for(int i = 0; i < s; i++){
printf("%d \n",T[i]); printf("%d \n",T[i]);
} }
......
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
void affichertab(int* T, int s); void affichertab(long* T, int s);
\ No newline at end of file \ No newline at end of file
No preview for this file type
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment