HW5.5

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的更多相关文章
- HW5.36
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.35
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.34
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.33
import java.util.Calendar; public class Solution { public static void main(String[] args) { long tot ...
- HW5.32
public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...
- HW5.31
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.30
public class Solution { public static void main(String[] args) { for(int i = 3; i <= 1000; i++) i ...
- HW5.29
public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...
- HW5.28
public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...
- HW5.27
public class Solution { public static void main(String[] args) { int totalCount = 0; int lineCount = ...
随机推荐
- Java EJX
EJX http://www.docin.com/p-121548732.html
- MVC-ActionResult解说
HttpNotFoundResult: 专门用来响应Http404找不到网页的错误,在System.Web.Mvc.Controller类别中内建了一个HttpNotFound()方法,可以很方便的回 ...
- online web design tool
https://webflow.com/ http://css-tricks.com/snippets/ https://www.fluidui.com/demos
- stdafx.h的作用以及原理
stdafx.h VC工程里面经常见到stdafx.h这个头文件,以前也没有特别注意,但是这个文件用不好经常会出错,所以就GOOGLE了一下,总算是弄清楚了... stdafx的英文全称为:Stand ...
- BZOJ 3713: [PA2014]Iloczyn
Description 斐波那契数列的定义为:k=0或1时,F[k]=k:k>1时,F[k]=F[k-1]+F[k-2].数列的开头几项为0,1,1,2,3,5,8,13,21,34,55,-你 ...
- Ubuntu 14.04远程登录服务器--ssh的安装和配置
ssh是一种安全协议,主要用于给远程登录会话数据进行加密,保证数据传输的安全,现在介绍一下如何在Ubuntu 14.04上安装和配置ssh 1.更新源列表 打开"终端窗口",输入& ...
- table 表头固定
<html> <head> <title>Test</title> <style type="text/css"> .d ...
- gif录制工具
gif录制工具 This tool allows you to record a selected area of your screen and save it as a Gif. http://s ...
- module_init宏解析
在init.h中我们看到 #define module_init(x) __initcall(x); 还看到 #define __initcall(fn) device_initcall(fn) 还有 ...
- Form表单中的三种查询方法
1.使用:parameter.G_query_find参数: IF (NAME_IN('PO_HEADERS.PO_HEADER_ID') IS NOT NULL) THEN :paramete ...