#include void InSertSort(int R[],int n);特别这一行void main(){int arr[]={0,1,2,3,4,5,6,7,8,9};int n=9;InSertSort(arr,10);}void InSertSort(int R[],int n)特别这一行{int i,j;int temp;for(i=1;i=0&&temp
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/02 22:38:09
![#include void InSertSort(int R[],int n);特别这一行void main(){int arr[]={0,1,2,3,4,5,6,7,8,9};int n=9;InSertSort(arr,10);}void InSertSort(int R[],int n)特别这一行{int i,j;int temp;for(i=1;i=0&&temp](/uploads/image/z/4251636-36-6.jpg?t=%23include+void+InSertSort%28int+R%5B%5D%2Cint+n%29%3B%E7%89%B9%E5%88%AB%E8%BF%99%E4%B8%80%E8%A1%8Cvoid+main%28%29%7Bint+arr%5B%5D%3D%7B0%2C1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%7D%3Bint+n%3D9%3BInSertSort%28arr%2C10%29%3B%7Dvoid+InSertSort%28int+R%5B%5D%2Cint+n%29%E7%89%B9%E5%88%AB%E8%BF%99%E4%B8%80%E8%A1%8C%7Bint+i%2Cj%3Bint+temp%3Bfor%28i%3D1%3Bi%3D0%26%26temp)
#include void InSertSort(int R[],int n);特别这一行void main(){int arr[]={0,1,2,3,4,5,6,7,8,9};int n=9;InSertSort(arr,10);}void InSertSort(int R[],int n)特别这一行{int i,j;int temp;for(i=1;i=0&&temp
#include
void InSertSort(int R[],int n);特别这一行
void main()
{
int arr[]={0,1,2,3,4,5,6,7,8,9};
int n=9;
InSertSort(arr,10);
}
void InSertSort(int R[],int n)特别这一行
{
int i,j;
int temp;
for(i=1;i=0&&temp
#include void InSertSort(int R[],int n);特别这一行void main(){int arr[]={0,1,2,3,4,5,6,7,8,9};int n=9;InSertSort(arr,10);}void InSertSort(int R[],int n)特别这一行{int i,j;int temp;for(i=1;i=0&&temp
这是个插入排序算法,void InSertSort(int R[],int n);为函数原型声明,告诉编译器,InSertSort为一个函数,有两个参数.这样在主函数中调用时,就不会出现编译错误.后面那个void InSertSort(int R[],int n)为函数的实现,对R里面的元素进行排序.具体算法原理可百度:插入排序算法.当然了,如果把函数的实现写在主函数前面,就可以把第一句void InSertSort(int R[],int n);删掉.