题目:输入三个整数x,y,z,请把这三个数由小到大输出。
package cn.ls.lanqiao;
import java.util.*;
public class Test15 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int t = 0;
if (a > b) {
t = a;
a = b;
b = t;
}
if (a > c) {
t = a;
a = c;
c = t;
}
if (b > c) {
t = b;
b = c;
c = t;
}
System.out.println(a + " " + b + " " + c);
}
}