#include <iostream> using namespace std; void SelectSort(int* a,int n){ for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ if(a[i] > a[j] ){ int tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } } } int main() { int a[] = {2,5,8,4,1,0,3,6,9,7}; int n = 10; SelectSort(a,n); for(int i=0;i<n;i++){ cout << a[i] << " "; } return 0; }