import java.util.Scanner;
public class ThreeSort {
public static void main(String[] args) {
System.out.println("请输入三个数:");
Scanner in = new Scanner(System.in);
int a = in.nextInt();
int b = in.nextInt();
int c = in.nextInt();
if(a>b){
int temp = a;
a = b;
b = temp;
}
if(a>c){
int temp = a;
a = c;
c = temp;
}
if(b>c){
int temp = b;
b = c;
c = temp;
}
System.out.println(a+","+b+","+c);
}
}
三个整数排序
最新推荐文章于 2022-08-23 18:58:39 发布