public static void main(String[] args) {
System.out.println(“请输入三个数”);
Scanner scanner=new Scanner(System.in);
int a=scanner.nextInt();
int b=scanner.nextInt();
int c=scanner.nextInt();
/*方法一
//int d=(a>b)?a:b;
//int max=(d>c)?d:c;
//简写
int max=(((a>b)?a:b)>c)?((a>b)?a:b):b;
System.out.println(“最大的数为:”+max);*/
//方法二
int mMax=a;
if(mMax<b) {
mMax=b;
}if(mMax<c) {
mMax=c;
}
System.out.println(“最大值为:”+mMax);
scanner.close();
}