import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);
         System.out.print("Enter three numbers: ");
         double n1 = input.nextDouble();
         double n2 = input.nextDouble();
         double n3 = input.nextDouble();

         input.close();

         displaySortedNumbers(n1, n2, n3);
     }

     public static void displaySortedNumbers(double num1, double num2, double num3)
     {
         if(num1 > num2 && num1 > num3)
         {
             if(num2 > num3)
                 System.out.println(num3 + " " + num2 + " " + num1);
             else
                 System.out.println(num2 + " " + num3 + " " + num1);
         }
         else if(num2 > num1 && num2 > num3)
         {
             if(num1 > num3)
                 System.out.println(num3 + " " + num1 + " " + num2);
             else
                 System.out.println(num1 + " " + num3 + " " + num2);
         }
         else if(num3 > num1 && num3 > num2)
         {
             if(num1 > num2)
                 System.out.println(num2 + " " + num1 + " " + num3);
             else
                 System.out.println(num1 + " " + num2 + " " + num3);
         }
     }
 }

HW5.5的更多相关文章

  1. HW5.36

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  2. HW5.35

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  3. HW5.34

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  4. HW5.33

    import java.util.Calendar; public class Solution { public static void main(String[] args) { long tot ...

  5. HW5.32

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  6. HW5.31

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW5.30

    public class Solution { public static void main(String[] args) { for(int i = 3; i <= 1000; i++) i ...

  8. HW5.29

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  9. HW5.28

    public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...

  10. HW5.27

    public class Solution { public static void main(String[] args) { int totalCount = 0; int lineCount = ...

随机推荐

  1. CentOS 6.X更新Python2.7.x版本 安装pip

    在安装新版之前安装 先安装bz2.zlib,执行下列代码进行安装 yum install -y zlib-devel bzip2-devel xz-libs wget openssl openssl- ...

  2. log4j记录运行日志

    1.在工程中导入log4j-1.2.15.jar的jar包2.新建测试类 package control; import org.apache.log4j.Logger; import org.apa ...

  3. c++ 重定位输出到DOS

    #define USE_WIN32_CONSOLE int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTST ...

  4. Hibernate与数据库分表

    数据库分片(shard)是一种在数据库的某些表变得特别大的时候采用的一种技术. 通过按照一定的维度将表切分,可以使该表在常用的检索中保持较高的效率,而那些不常用的记录则保存在低访问表中.比如:销售记录 ...

  5. 在Unity中高效工作(下)

    原地址:http://www.unity蛮牛.com/thread-20005-1-1.html Tips for Creating Better Games and Working More Eff ...

  6. 不改变中间层,如何玩转 .NET 的远程处理功能?

    原文链接: https://msdn.microsoft.com/enus/library/aa289846(v=vs.71).aspx Visual Studio .NET 2003 该方案展示了传 ...

  7. MySQL db优化

    http://blog.csdn.net/likika2012/article/details/38816037 http://www.nowamagic.net/librarys/veda/deta ...

  8. [AC自动机]HDOJ3695 Computer Virus on Planet Pandora

    题意:给t.n,t个案例,n个字符串 下面给n+1个字符串,n个互不相同的小串,最后一个是模式串 模式串会出现[qx]的形式,q为数字,x为一个字母 问n个小串在模式串中出现的个数,正着出现.反着出现 ...

  9. Codeforces Burning Midnight Oil

    /* * BurningMidnightOil.cpp * * Created on: 2013-10-12 * Author: wangzhu */ /** * 每次至少写多少行代码ret: * 1 ...

  10. [jobdu]数组中的逆序对

    http://ac.jobdu.com/problem.php?pid=1348 数组中的逆序对也是个常见的题目,算法导论中也有一些描述,参考:http://www.cnblogs.com/wuyue ...