public class Dome1 {
public static void main(String[] args) {
int a[]= {99,86,12,31,45,29,61,22};
int index=0;
for ( int i=1; i<a.length; i++) {
for ( int j=1; j<a.length-i ;j++) {
if ( a[index]>a[j]) {
index=j;
}
}
int tmp=a[a.length-i];
a[a.length-i]=index;
index=tmp;
}
System.out.println("选择排列结果为:");
for ( int tmp:a) {
System.out.print(tmp+" ");
}
}
}
问一下,那里错了啊
首页上一页 1 下一页尾页 3 条记录 1/1页