摘要: 插入排序 #include using namespace std;void sort_(int test[],int nLen){ int j = 0; for(int i = 1;i<nLen;i++) { int temp = test[i]; j=... 阅读全文
posted @ 2012-12-17 00:25 byfei 阅读(43) 评论(0) 推荐(0)
摘要: #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 阅读(131) 评论(0) 推荐(0)