标签:
package com.lovo;
public class Test10 {
public static void main(String[] args) {//冒泡
int [] a = {1,5,2,8,7};
for(int i=0;i<a.length-1;i++){
for(int j=0;j<a.length-1;j++){
if(a[j]<a[j+1]){
int c = a[j+1];
a[j+1]=a[j];
a[j]=c;
}
}
for(int z=0;z<a.length;z++){
System.out.println(a[z]);
}
}
}
标签:
原文地址:http://www.cnblogs.com/caolyl/p/4870219.html