import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);

         System.out.print("Please enter n1: ");
         int n1 = input.nextInt();
         System.out.print("Please enter n2: ");
         int n2 = input.nextInt();
         System.out.print("Please enter n3: ");
         int n3 = input.nextInt();

         input.close();

         if(n1 <= n2 && n1 <= n3)
         {
             if(n2 >= n3)
             {
                 int temp = n3;
                 n3 = n2;
                 n2 = temp;
             }
         }
         if(n2 <= n1 && n2 <= n3)
         {
             int temp = n2;
             n2 = n1;
             n1 = temp;
             if(n3 <= n2)
             {
                 int anotherTemp = n3;
                 n3 = n2;
                 n2 = anotherTemp;
             }
         }
         if(n3 <= n1 && n3 <= n2)
         {
             int temp = n1;
             n1 = n3;
             n3 = temp;
             if(n3 <= n2)
             {
                 int anotherTemp = n2;
                 n2 = n3;
                 n3 = anotherTemp;
             }
         }

         System.out.println("n1 = " + n1);
         System.out.println("n2 = " + n2);
         System.out.println("n3 = " + n3);
     }
 }

HW3.8的更多相关文章

  1. HW3 纠结的心得

    改好的controller //yuec2 Yue Cheng package hw3; import java.io.File; import java.text.DecimalFormat; im ...

  2. 基于卷积神经网络的面部表情识别(Pytorch实现)----台大李宏毅机器学习作业3(HW3)

    一.项目说明 给定数据集train.csv,要求使用卷积神经网络CNN,根据每个样本的面部图片判断出其表情.在本项目中,表情共分7类,分别为:(0)生气,(1)厌恶,(2)恐惧,(3)高兴,(4)难过 ...

  3. Software Testing hw3

    (a):可绘制出如下图所示的流程图 (b):对于测试用例t1=(n=3)和t2=(n=5),MAXPRIMES = 4时,t1不能检查出错误,而t2则会发生数组越界错. (c):要使测试路径不通过wh ...

  4. HW3.29

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

  5. HW3.28

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

  6. HW3.27

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

  7. HW3.26

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

  8. HW3.25

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

  9. HW3.24

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

  10. HW3.23

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

随机推荐

  1. WinForm小小应用

    制作日历计划任务 private void BeginTask() { Thread th = new Thread(//建立线程 (() =>//使用Lambda表达式 { while (tr ...

  2. C99标准中的部分新特性

    我有点怀疑我会不会C语言了. 1.变长数组(VLA) ; scanf("%d", &n); int arr[n]; 2.数组初始化 ] = {[] = , [] = , [ ...

  3. java转义字符(转载)

    转载自:http://blog.163.com/dingyi_57@126/blog/static/110479195200911229337281/ 一.为什么要使用转义字符? 1.  HTML中& ...

  4. 扩展pl0编译器设计——总述

    所谓编译器,实际上就是我们编程时将输入的高级语言代码转换成相应的目标代码,从而实现将目标代码转换成汇编码的一种过渡工具. 这种工具根据具体情况不同,可以将不同的高级语言代码转换成不同的目标代码,例如将 ...

  5. icon在线编辑和查找工具

    1.www.iconpng.com 2.在线编辑http://www.ico.la/ 3.小图标查找 http://icomoon.io/app/ 4.20个免费的psd http://www.osc ...

  6. activity的测试工程activiti-explorer使用

    1. activiti-explorer默认使用h2数据库,第一步要修改db.properties的配置,如果使用其他数据库的话,务必放入驱动包,oracle的ojdbc4不能用,会报错,要使用版本高 ...

  7. 到底DAO是什么?为什么要有它的存在?

    Data Access Object   数据访问接口,就是访问数据库方法的 interface 1. DAO用来封装Data Source的..就比如,Connection conn = DAOFa ...

  8. Windows 内核(WRK)编译

    引子 WRK 是微软于 2006 年针对教育和学术界开放的 Windows 内核的部分源码, WRK(Windows Research Kernel)也就是 Windows 研究内核, 在 WRK 中 ...

  9. QReadWriteLock 读写锁的区别

    QReadWriteLock 这个允许多个进程同时读,但是只有一个写.而且写读不能同时进行. 文档里语焉不详,这是我自己的理解: lockForWrite 为写而锁,就是要修改数据,外人连想进来读数据 ...

  10. Emeditor所有快捷键操作

    新建文本    Ctrl+N         创建一个新的文本文件. 打开         Ctrl+O    打开一个已存在的文件. 保存         Ctrl+S     保存当前文件. 重新 ...