- import java.util.*;
- class GetMax{
- public static void max(){
- Scanner sc= new Scanner(System.in);
- System.out.println("请输入第一个数");
- int a=sc.nextInt();
- System.out.println("请输入第二个数");
- int b=sc.nextInt();
- System.out.println("请输入第三个数");
- int c=sc.nextInt();
- System.out.println(a>b?(a>c?a:c):(b>c?b:c));
- }
- }
复制代码 |
|