public class Main {
    public static void main(String[] args) {
        // 声明两个 int 类型的变量 x、y
        int x, y;
        // 将 62、97 分别赋值给 x、y
        x = 62;
        y = 97;
        // 比较 x、y 的大小,输出其中的大者
        if (x > y) {
            System.out.println('x is greater than y');
        } else {
            System.out.println('y is greater than x');
        }
    }
}
Java 比较两个整数大小并输出较大者

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

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