qfedu-c-level/day8/homework/h2/tempfiles/b.c

20 lines
432 B
C
Raw Normal View History

#include "b.h"
#include <stdio.h>
int *arrSort(int arrInput[], int arrlen)
{
int i, j, temp;
for (i = 0; i < arrlen - 1; i++)
{
for (j = 0; j < arrlen - 1 - i; j++)
{
if (arrInput[j] > arrInput[j + 1])
{
temp = arrInput[j];
arrInput[j] = arrInput[j + 1];
arrInput[j + 1] = temp;
}
}
}
return arrInput;
}