public class E {
/**
* @param args
*/
//如(1,3,5,12,4,6,8,9,15,11)
public static void main(String[] args) {
// TODO Auto-generated method stub
int a[]={1,3,5,12,4,6,8,9,15,11};
for (int i = 1; i < a.length; i++) {
for (int j = 0; j < a.length-i; j++) {
if (a[j]<a[j+1]) {
int tmpe=a[j];
a[j]=a[j+1];
a[j+1]=tmpe;
}
}
}
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
}
}
希望对你有所帮助