冒泡
package 冒泡;
import java.util.Scanner;
public class Maopao2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int []i=new int[6];
Scanner s=new Scanner(System.in);
for(int x=0;x<i.length;x++){
System.out.print("请输出第"+(x+1)+"个数");
i[x]=s.nextInt();
}
for(int j=0;j<i.length-1;j++){
for(int r=0;r<i.length-1-j;r++){
int temp=0;
if(i[r]<i[r+1]){
temp=i[r];
i[r]=i[r+1];
i[r+1]=temp;
}
}
}
for(int k=0;k<i.length;k++){
System.out.print(i[k]+" ");
}
}
}