//简单选择排序 #include using namespace std; void selectSort(int r[], int n){ int i,index,j; for(i=1; i r[j]) { index = j; } } if(index != i) { int temp = r[index]; r[index] = r[i]; r[i] = temp; } } } int main() { int array[]={4,6,2,8,12,55,3,1,0}; int n = sizeof(array)/sizeof(array[0]); selectSort(array, n); for(int i=1; i