佛曰这是冒泡

package Z4;

import java.util.Scanner;

public class ShuZu {
public static void main (String[]args){
Scanner input= new Scanner(System.in);
int i[]=new int[3];
for(int i1=0;i1<i.length;i1++){
i[i1]=input.nextInt();
}


for(int q=0;q<i.length-1;q++){
for(int w=q+1;w<i.length ;w++){
if(i[q]>i[w]){
int zancun=i[w];
i[w]=i[q];
i[q]=zancun;
}
}
System.out.println(i[q]);
}

// System.out.print(i[1]);
System.out.print(i[i.length-1]);






}
}

posted @ 2018-07-21 18:11  米佳5714  阅读(83)  评论(0编辑  收藏  举报