输出图片和代码在这
#include <stdio.h>
int main()
{
int a[50],n,i,j,temp;
scanf("%d",&n);
for(i = 0;i < n;i++)
{
scanf("%d",&a[i]);
}
scanf("%d",&a[n+1]);
for(i = 0;i < n+1;i++)
{
for(j = i + 1;j < n + 1;j++)
{
if(a[i] > a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
for(i = 0;i < n + 1 ;i++)
{
printf("%d ",a[i]);
}
putchar('\n');
return 0;
}
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/33280496753615.png "=600 #left")
上面三行是输入,下面一行是输出的结果
10
1 2 3 4 5 6 7 9 10 11
8
1 2 3 4 5 6 7 9 10 11 268501009