34 lines
1.1 KiB
C
34 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_sort_int.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbrochar <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2015/12/05 18:36:08 by gbrochar #+# #+# */
|
|
/* Updated: 2015/12/07 11:04:19 by gbrochar ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_sort_int(int *tab, int size)
|
|
{
|
|
int i;
|
|
int tmp;
|
|
|
|
i = 0;
|
|
while ((i + 1) < size)
|
|
{
|
|
if (tab[i] > tab[i + 1])
|
|
{
|
|
tmp = tab[i];
|
|
tab[i] = tab[i + 1];
|
|
tab[i + 1] = tmp;
|
|
i = 0;
|
|
}
|
|
else
|
|
i++;
|
|
}
|
|
}
|