关键部分程序如下: public static void Main(string[] args) { int []a={4,3,1,8,2,9,7,6,0,5}; int i,j,k,temp; for(i = 0; i < 9; i++) { k = i; for(j = i + 1; j < 10; j++) { if(a[k] > a[j]) { k = j; } } if(k != i) { temp = a[i]; a[i] = a[k]; a[k] = temp; } }for(i=0;i<10;i++){Console.Write(a[i]);Console.Write(" ");} }数据输入/输出你可另外设置