greatest among three numbers
public class Solution {
public static void main(String[] args) {
Scanner ip = new Scanner(System.in);
System.out.print("Enter A: ");
int a = ip.nextInt();
System.out.print("Enter B: ");
int b = ip.nextInt();
System.out.print("Enter C: ");
int c = ip.nextInt();
int great = a >= b ? (a >= c ? a : c) : (b >= c ? b : c);
System.out.println("Greatest among three numbers is: " + great);
ip.close();
}
}
OUTPUT:
Enter A:
Enter B:
Enter C:
Greatest among three numbers is:
greatest among three numbers的更多相关文章
- ural 1352. Mersenne Primes
1352. Mersenne Primes Time limit: 1.0 secondMemory limit: 64 MB Definition. If the number 2N−1 is pr ...
- Must practice programming questions in all languages
To master any programming languages, you need to definitely solve/practice the below-listed problems ...
- HDU 1423 Greatest Common Increasing Subsequence LCIS
题目链接: 题目 Greatest Common Increasing Subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: ...
- The Hundred Greatest Theorems
The Hundred Greatest Theorems The millenium seemed to spur a lot of people to compile "Top 100& ...
- POJ 2127 Greatest Common Increasing Subsequence -- 动态规划
题目地址:http://poj.org/problem?id=2127 Description You are given two sequences of integer numbers. Writ ...
- HDOJ 1423 Greatest Common Increasing Subsequence -- 动态规划
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1423 Problem Description This is a problem from ZOJ 2 ...
- Geeks Interview Question: Ugly Numbers
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, ...
- Working with Numbers in PL/SQL(在PL/SQL中使用数字)
This article gives you all the information you need in order to begin working with numbers in your P ...
- HDU1423:Greatest Common Increasing Subsequence(LICS)
Problem Description This is a problem from ZOJ 2432.To make it easyer,you just need output the lengt ...
随机推荐
- python threading ThreadPoolExecutor
线程池,为什么要使用线程池:1. 线程中可以获取某一个线程的状态或者某一个任务的状态,以及返回值2. 当一个线程完成的时候我们主线程能立即知道3. futures可以让多线程和多进程编码接口一致 获取 ...
- Linux RAID 磁盘管理
Linux RAID 磁盘管理 RAID工作模式介绍:https://www.cnblogs.com/xiangsikai/p/8441440.html 本章主要讲解 Linux下 RAID5 与 R ...
- 【UOJ#49】【UR #3】轴仓库
[UOJ#49][UR #3]轴仓库 题面 UOJ 题解 不难发现一定是每次找到离当前位置最近的一个箱子,然后把它搬过来. 那么如果我们能够确定起始位置,我们就可以二分从两侧多少距离搬箱子,判断一下时 ...
- Microsoft.Extensions.DependencyInjection 之二:使用诊断工具观察内存占用
目录 准备工作 大量接口与实现类的生成 elasticsearch+kibana+apm asp.net core 应用 请求与快照 Kibana 上的请求记录 请求耗时的分析 请求内存的分析 第2次 ...
- 【09】Nginx:静态压缩 / 日志切割 / 防盗链 /恶意解析/ 跨域
写在前面的话 上一节我们谈了关于 nginx 服务器的一些简单的安全优化问题,能够帮助我们解决一部分线上服务存在的安全隐患.但是想要提升用户体验这是原因不够的,我们还需要从服务的优化方面入手. 本节更 ...
- WPF 动态资源 DataContext="{DynamicResource studentListKey}" DisplayMemberPath="Name"
public class StudentList:ObservableCollection<Student> { public List<Student> studentLis ...
- Winform中怎样跨窗体获取另一窗体的控件对象
场景 Winform中实现跨窗体获取ZedGraph的ZedGraphControl控件对象: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/de ...
- 谁在使用GPU?
nvidia-smi命令可以查看GPU使用情况,但是只能看到占用每个GPU的进程ID.根据进程ID可以得到进程详情,进程详情中包括用户ID,根据用户ID可以获取用户名称,从而知道哪个用户在使用GPU. ...
- redis笔记2
分布式锁的实现 锁是用来解决什么问题的; 一个进程中的多个线程,多个线程并发访问同一个资源的时候,如何解决线程安全问题. 一个分布式架构系统中的两个模块同时去访问一个文件对文件进行读写操作 多个应用对 ...
- Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录
Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录 作为系统管理员,top命令看到users有多个用户登录,会需要查看下是否被黑客进入了. 实战例子:top命令:top - ...