#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/05/04 20:34:49
#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

#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);删掉.