This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

View File

@ -0,0 +1,52 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sort_int_tab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/19 19:08:01 by cchauvet #+# #+# */
/* Updated: 2022/07/19 20:49:46 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
void ft_sort_int_tab(int *tab, int size)
{
int i;
int j;
int tempo;
i = 0;
while (i < size)
{
j = 0;
while (j < size - 1)
{
if (tab[j] > tab[j + 1])
{
tempo = tab[j];
tab[j] = tab[j + 1];
tab[j + 1] = tempo;
}
j++;
}
i++;
}
}
/*
#include <stdio.h>
int main()
{
int tab[] = {6,5,4,3,2,1};
int i = 0;
ft_sort_int_tab(tab, 6);
while (i < 6)
{
printf("%d,", tab[i]);
i++;
}
}
*/