随笔分类 -  排序

摘要:#include <iostream>using namespace std;void sort_(int test[],int nLen){ int j = 0; for(int i = 1;i<nLen;i++) { int temp = test[i]; j=i-1; while(temp < test [j]) { test[j+1] = test[j]; j--; } test[j+1] = temp; }}void main(){ int test []={1,3,5,9,7,2,4,6,8,10,0}; int nLen = sizeof (test)/s 阅读全文
posted @ 2012-12-17 00:24 byfei 阅读(120) 评论(0) 推荐(0) 编辑