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 = ...
随机推荐
- CODEVS 2994 超级弹珠
题目描述 Description 奶牛们最近从著名的奶牛玩具制造商Tycow那里,买了一套仿真版彩蛋游戏设备.Bessie把她们玩游戏的草坪划成了N*N单位的矩阵,同时列出了她的K个对手在草地上的位置 ...
- Elasticsearch强大的聚合功能Facet
在常规数据库中,我们都知道有一个sql就是group,分组.如果主表只有对应的一个列记录的分组的ID,那么还好统计,比如说每本书book表,有一个分类catId,记录是属于哪一类的书,那么直接按照ca ...
- BZOJ 2442: [Usaco2011 Open]修剪草坪
Description 在一年前赢得了小镇的最佳草坪比赛后,FJ变得很懒,再也没有修剪过草坪.现在,新一轮的最佳草坪比赛又开始了,FJ希望能够再次夺冠.然而,FJ的草坪非常脏乱,因此,FJ只能够让他的 ...
- jacob访问ocx控件方法和遇到的问题
最近在进行摄像机的二次开发,摄像机厂商提供了使用C++开发的ocx控件:所以尝试使用jacob来进行访问. 操作步骤如下: 1, 从官网(http://sourceforge.net/projects ...
- java数组或集合返回空的问题
在有返回值的情况下,平时我写代码基本遇到错误什么都是返回null,我因为我觉得把数组或集合这个初始化占空间. 但是我发现这样在每次客户段调用都要进行非空判断,而且有时调用内置api还容易报错误,于是解 ...
- JNI编程(二) —— 让C++和Java相互调用(2)
3.getRamdomOrder() 这个方法会从backend得到一个随机的Order对象(抱歉这里“Random”拼错了),然后再调用java中相应的通知方法来通知foreground.getRa ...
- asp.net web 开发登录相关操作的控件LoginName、LoginStatus和LoginView控件使用详解
http://book.51cto.com/art/200909/154039.htm http://book.51cto.com/art/200909/154041.htm ASP.NET提供了一套 ...
- Linux kernel ‘lbs_debugfs_write’函数数字错误漏洞
漏洞名称: Linux kernel ‘lbs_debugfs_write’函数数字错误漏洞 CNNVD编号: CNNVD-201311-421 发布时间: 2013-11-29 更新时间: 2013 ...
- Android 所有颜色代码
colors.xml <?xml version="1.0" encoding="utf-8" ?> <resources> <c ...
- Linux中ifreq 结构体分析和使用
结构原型: struct ifreq{#define IFHWADDRLEN 6 union { char ifrn_name[IFNAMSIZ]; } ifr_ifrn; union { ...