import java.util.Scanner; public class if练习题1 { public static void main(String[] args) { //1.键盘录入两个变量,用if语句获取两个变量的最大值,并输出. Scanner sc = new Scanner(System.in); System.out.println("请输入第一个整数"); int a = sc.nextInt(); System.out.println("请输入第二个整数"); int b = sc.nextInt(); if (a>b ) { System.out.println(a); } else if (b>a) { System.out.println(b); } } }
07-11
76
04-24
7735
03-16
1814