摘要: //C++ 排序方法的总结#include <iostream>#include <vector>using namespace std;/*采用插入法进行排序*/void InsertArray(int a[],int n, int* &b){ int temp; int j; for(int i = 0;i<n-1;i++) { j = i; while(a[j]>a[j+1]) //后者小于前者,交换 { temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; if(j>0) { j--; } } } b = 阅读全文
posted @ 2012-08-08 15:41 CBDoctor 阅读(225) 评论(0) 推荐(0)