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 ...
随机推荐
- Vijos P1062 迎春舞会之交谊舞
题目链接:https://vijos.org/p/1062 题意:输入n(n <= 1500)个女生左边有多少个男生.每个女生都和她左边最近的男生跳舞. 输出每个女生到可以与之跳舞的男生之间有几 ...
- poj 1830 开关问题
开关问题 题意:给n(0 < n < 29)开关的初始和最终状态(01表示),以及开关之间的关联关系(关联关系是单向的输入a b表示a->b),问有几种方式得到最终的状态.否则输出字 ...
- 2014年度辛星html教程夏季版第五节
如果读者是一位后台开发者,那么肯定会知道什么叫表单,这里我们就介绍一下前台如何使用表单,表单的使用也是我们编写网页的必须经历的一关,而且,表单也往往是我们网站的漏洞和弱点出现的地方. ******** ...
- C# Windows Service调用IBM Lotus Notes发送邮件
近日研究了下IBM Lotus Mail,这货果然是麻烦,由于公司策略,没有开放smtp,很多系统邮件都没有办法发送,于是入手google学习Lotus Mail,想做成Windows服务,提供wcf ...
- MJRefreshFooterView
实例化header和footer _header = [MJRefreshHeaderView header]; _header.scrollView = _tableView; 设置header和f ...
- Python 知识点
1. generator #g is a generator and g is iterable g = (x*x for x in range(5)) for n in g: print(n) # ...
- Provider Communication with Apple Push Notification Service
This chapter describes the interfaces that providers use for communication with Apple Push Notificat ...
- oracle删除表的方法
1. 删除oracle表中的所有数据而不删除表: 语法: TRUNCATE TABLE table_name; 使用这条语句只是删除表中的全部数据,不是删除表,这种方式也叫做截断表,这种方式比使用de ...
- tbr tbn tbc
http://tech.bobgo.net/?m=201004 因为最近的工作需要从MP4视频中提取一些关键帧,要了解如何将视频的时间点转换为对应的帧号,所以查阅了一些关于视频编解码以及时间同步方式的 ...
- IEHelper - Internet Explorer Helper Class
http://www.codeproject.com/Articles/4411/IEHelper-Internet-Explorer-Helper-Class Discussions (81) IE ...