import java.util.Scanner;
/**
* @ Author:Qiutong
* @ Date:2020/7/8
* @ Description:三个实数由小到大排序
*/
public class Zz3 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("请输入第一个数字:");
double a=sc.nextDouble();
System.out.println("请输入第二个数字:");
double b=sc.nextDouble();
System.out.println("请输入第三个数字:");
double c=sc.nextDouble();
double temp;
if(a>b){
temp=a;
a=b;
b=temp;
}
if(a>c){
temp=a;
a=c;
c=temp;
}
if(b>c){
temp=b;
b=c;
c=temp;
}
System.out.println(a+","+b+","+c);
}
}
java实现三个实数由小到大排列
最新推荐文章于 2022-09-01 19:15:54 发布