if语句的嵌套使用之获取三个数据的最大值
2024-09-30 07:02:32
获取三个数据的最大值:
class Hello2 {
public static void main(String[] args) {
int a = 10;
int b = 20;
int c = 30;
int max;
if (a > b){
if (a > c)
{
max = a;
}else {
max = c;
}
}else {
if (b < c)
{
max = c;
}else {
max = b;
}
}
System.out.println("max = " + max);
}
}
结果:
最新文章
- Python模拟HttpRequest的方法总结
- ffmpeg 音频转换: use ffmpeg convert the audio from stereo to mono without changing the video part
- php 投票系统练习
- linux服务器报Too many open files的解决方法
- hydra爆破用法
- php 类
- 通过magento后台的magento connect安装magento extension
- Eclipse设置软tab(用4个空格字符代替)及默认utf-8文件编码(unix)
- JS中的自执行函数
- JS——基础知识(三)
- Tomcat和java的安装
- SqlServer存储过程,学习
- /etc/hosts,GoldenGate
- eclipse 关联 Maven本地仓库的配置
- React(0.13) 定义一个动态的组件(函数作为动态的值)
- hadoop hbase install (2)
- kafka操作清单
- python常用工具
- 为Linux设置IPTables防火墙
- luogu 1437 敲砖块(DP)
热门文章
- BZOJ 5450 轰炸 (强连通缩点+DAG最长路)
- Spring bean相关
- go中基本数据类型的默认值
- Solr的学习使用之(二)schema.xml等配置文件的解析
- OC学习--继承
- Windows下svn使用教程
- 第二节:链接mongodb服务器
- Ubunu12.04 vncserver xstartup配置文件
- eclipse 启动项目 报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLis(亲测)
- 【SPOJ1811】Longest Common Substring(后缀自动机)