安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

用Java写一个求三个数中最大的代码

  • 日期: 2026-02-03
  • 标签: 社会

public class MaxOfThreeNumbers {

public static void main(String[] args) {
    int a = 10;
    int b = 20;
    int c = 30;

    int max = a;

    if (b > max) {
        max = b;
    }

    if (c > max) {
        max = c;
    }

    System.out.println("最大值是:" + max);
}

}

用Java写一个求三个数中最大的代码

原文地址: http://www.cveoy.top/t/topic/bVbP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: python 中 f与的区别
  • 下一篇: 阅读以下链接文章:httpsepaperscdailycnshtmlscrb20230411292586shtml并结合农村基层工作实际写一篇网评文章

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2