import java.util.Scanner;//导包
public class test1321{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);//
System.out.println("请输入第一个数");//第一个数接收对象
int a = sc.nextInt();
System.out.println("请输入第二个数");
int b = sc.nextInt();
int max = sum(a,b);
System.out.println("最大的数为" + max);
}
public static int sum(int a,int b){
int max = (a > b) ? a : b;//三元运算符,输出最大值
return max;
}
}
10-17
1008
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)