Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
166667 C班-朱永裕 常用排序法 C++ 编译错误 0 0 MS 0 KB 426 2024-08-19 15:07:48

Tests(0/0):


void InsertSort(int n) //对n个元素排序 { for(int i=2; i<=n; i++) { int temp=a[i]; //temp为要插入的元素 int j=i-1; while(j>=1 && temp<a[j]) //从a[i-1]开始向前找比a[i]小的数 { a[j+1]=a[j]; //同时把数组元素向后移 --j; } a[++j]=temp; //插入 } }


测评信息: