HW3.8

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的更多相关文章
- HW3 纠结的心得
改好的controller //yuec2 Yue Cheng package hw3; import java.io.File; import java.text.DecimalFormat; im ...
- 基于卷积神经网络的面部表情识别(Pytorch实现)----台大李宏毅机器学习作业3(HW3)
一.项目说明 给定数据集train.csv,要求使用卷积神经网络CNN,根据每个样本的面部图片判断出其表情.在本项目中,表情共分7类,分别为:(0)生气,(1)厌恶,(2)恐惧,(3)高兴,(4)难过 ...
- Software Testing hw3
(a):可绘制出如下图所示的流程图 (b):对于测试用例t1=(n=3)和t2=(n=5),MAXPRIMES = 4时,t1不能检查出错误,而t2则会发生数组越界错. (c):要使测试路径不通过wh ...
- HW3.29
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW3.28
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW3.27
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW3.26
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW3.25
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW3.24
public class Solution { public static void main(String[] args) { int number = (int)(Math.random() * ...
- HW3.23
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
随机推荐
- vim file save as
the command of vim to save as the file :w new_file_name
- Oracle 分析函数之聚集函数(MAX、MIN、AVG和SUM)
MAX 查找组中表达式的最大值 MAX(COL ) OVER ( [ <partition_by_clause> ] < order_by_clause > )MIN 查找组中 ...
- 查看uCOS-II的CPU使用率
代码模板: void main(void) { OSInit(); /* 安装uCOS-II的任务切换向量 */ /* 创建用户起始任务TaskStart */ OSStart(); } void T ...
- 关于c++字符串的while(*temp++)
首先,上一段代码 static bool reverse_str(const char *str) { const char *temp=str; while(*temp++); temp-=; // ...
- ExtJS4.2学习(16)制作表单(转)
鸣谢:http://www.shuyangyang.com.cn/jishuliangongfang/qianduanjishu/2013-12-10/188.html --------------- ...
- HDU 1176 免费馅饼(DP)
点我看题目 题意 : 中文题.在直线上接馅饼,能接的最多是多少. 思路 :这个题其实以前做过.....你将这个接馅饼看成一个矩阵,也不能说是一个矩阵,反正就是一个行列俱全的形状,然后秒当行,坐标当列, ...
- Memcached总结一:memcached简介及适用和不适应场景
Memcached是免费的,开源的,高性能的,分布式内存对象的缓存系统(键/值字典),旨在通过减轻数据库负载加快动态Web应用程序的使用. Memcached是由布拉德·菲茨帕特里克(Brad Fit ...
- .Net remoting, Webservice,WCF,Socket区别
传统上,我们把计算机后台程序(Daemon)提供的功能,称为"服务"(service).比如,让一个杀毒软件在后台运行,它会自动监控系统,那么这种自动监控就是一个"服务& ...
- Ember.js demo5
<!DOCTYPE html> <html> <head> <meta name="description" content=" ...
- linux内存管理机制
物理内存和虚拟内存 我们知道,直接从物理内存读写数据要比从硬盘读写数据要快的多,因此,我们希望所有数据的读取和写入都在内存完成,而内存是有限的,这样就引出了物理内存与虚拟内存的概念. 物理内存就是系统 ...