System.out.println("请输入3个整数:"); int x = sc.nextInt(); int y = sc.nextInt(); int z = sc.nextInt(); int i = 0; if(x>y){ i=y; y=x; x=i; } if(x>z){ i=z; z=x; x=i; } if(y>z){ i=z; z=y; y=i; } System.out.println("从小到大排序后的结果:")...
int z = sc.nextInt(); System.out.println("从小到大排序后的结果:"); if (x < y && x < z) { if (y < z) { System.out.println(x + "<" + y + "<" + z); } else { System.out.println(x + "<" + z + "<" + y); } } else if (y < x && y < z) { if (x ...
输入三个整数x,y,z,请把这三个数由小到大输出。 实现代码: 第1种方法: import java.util.Scanner;public class xyzMaxMin{public static void main(String[] args) {Scanner sc = new Scanner(System.in);System.out.println("请输入3个整数:");int x = sc.nextInt();int y = sc.nextInt();int...