/*
题目:输入三个整数x,y,z,请把这三个数由小到大输出。
*/
import java.util.*;
public class Class15 {
public static void main(String[] args) {
int[] array = new int[3];
System.out.println("输入数字:");
Scanner sc = new Scanner(System.in);
for(int i = 0; i < array.length; i++){
System.out.println("请输入第"+(i+1)+"个数字,并回车:");
array[i] = sc.nextInt();
}
Maopao mp = new Maopao();
int[] mp1 = mp.Maopao(array);
for (int i = 0; i < mp1.length; i++) {
System.out.println(mp1[i]);
}
}
static class Maopao{
public int[] Maopao(int[] array){
for(int i = 0; i < array.length - 1; i++){
for(int j = 0; j < array.length - 1; j++){
if(array[j] > array[j + 1]){
int temp = array[j];
array[j] = array[j + 1];
array[j + 1] = temp;
}
}
}
return array;
}
}
}