希望写一个输入数组并排序的程序,希望用函数嵌套解决,希望各位大佬看一下
希望写一个输入数组并排序的程序,希望用函数嵌套解决,希望各位大佬看一下#include<stdio.h>
int paixu( int shuzhu[],int n)
{ int i,ii,t;
for(i=0;i<n;i++)
{
for(ii=0;ii<n-1;ii++)
{
if(shuzhu[i]>shuzhu[i+1])
t=shuzhu[i];shuzhu[i]=shuzhu[i+1];shuzhu[i+1]=t;
}
}
return shuzhu[i];
}
void main()
{
int shuzhu[100],i;
for(i=0;i<10;i++)
{
scanf("%d",&shuzhu[i]);
}
paixu(shuzhu[100],i);
for(i=0;i<10;i++)
printf("%d",shuzhu[i]);
}