int main()
{
int a[10];
int i, j, t;
for (i = 0; i <= 9; i++)
scanf_s("%d", &a[i]);
for (i = 0; i <= 9; i++)
{
printf("%d\t", a[i]);
if (i == 4)
putchar('\n');
}
putchar('\n');
printf("write ok\n");
for (i = 0; i <= 9 - 1; i++) //十个数需要进行九次的沉底,最后一个自行冒出
for (j = 0; j <= 9 - 1 - i; j++) //第一轮,十个数需要对比九次,第二次九个数需要对比八次……
if (a[j] > a[j + 1])
{
t = a[j];
a[j] = a[j + 1];
a[j + 1] = t;
}
for (i = 0; i <= 9; i++)
{
printf("%d\t", a[i]);
if (i == 4)
putchar('\n');
}
putchar('\n');
return 0;
}