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 = ...
随机推荐
- 【BZOJ】3309: DZY Loves Math 莫比乌斯反演优化
3309: DZY Loves Math Description 对于正整数n,定义f(n)为n所含质因子的最大幂指数.例如f(1960)=f(2^3 * 5^1 * 7^2)=3, f(10007) ...
- Oracle 插入数据
6个柜面交易 打印修改--050101 delete from tran_prints where tran_id = (select id from tran where code='050101' ...
- 开发错误日志之FTP协议传输文件问题
从开发端用FTP协议向服务器(Linux系统)传输文件时,cat -A查询文件内容中行尾会有^M出现. 解决方案:改用SFTP协议上传文件.
- 《JavaScript设计模式与开发实践》-面向对象的JavaScript
设计模式 面向对象 动态类型语言 编程语言按照数据类型大体分为:静态类型语言和动态类型语言. 静态类型语言在编译时便已确定变量的类型,而动态类型语言的变量类型要到程序运行时,待变量被赋予某个值之后,才 ...
- GC的代机制
1.代为CLR垃圾回收器采用的一种机制,基于以下几点假设:对象越新,生存期越短:对象越老,生存期越长: 2.托管堆仅支持3代(GC.MaxGeneration,第0代.第1代.第2代),CLR初始化会 ...
- vs运行代码版本不一致删除缓存
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
- 应该知道的25个非常有用的CSS技巧
在我们的前端CSS编码当中,经常要设置特殊的字体效果,边框圆角等等,还要考虑兼 容性的问题, CSS网页布局,说难,其实很简单.说它容易,往往有很多问题困扰着新 手,在中介绍了非常多的技巧,这些小技巧 ...
- Struts2 web.xml文件配置
在导入了项目需要使用的核心jar包之后需要在web.xml中配置Struts. 1. Struts2的知识点普及: Struts2共有5类配置文件,分别罗列如下: 1), Web.xml; 在没有使用 ...
- JS获取IP、MAC和主机名的几种方法
方法一(只针对IE且客户端的IE允许AcitiveX运行,通过平台:XP,SERVER03,2000): 获取客户端IP. <HTML> <HEAD> <TITLE> ...
- Linux下eclipse的安装以及配置
在安装好jdk并配置好后,就可以进行eclipse的安装了,其步骤如下: 1.下载eclipse 我所用的eclipse为:eclipse-dsl-juno-SR1-linux-gtk.tar 2. ...