package xiti3;
//求出3个数中的最大值,并输出最大值
public class Third {
public static void main(String[] args) {
/*
* //方法一
int a,b,c,d,max;
a=1;
b=2;
c=3;
if(a>=b){
d=a;
}
else
d=b;
if(d>=c){
max=d;
}else
max=c;
System.out.println("abc中最大值是"+max);
*/
/*
//方法二
int a,b,c,d,max;
a=1;
b=2;
c=3;
d=(a>b)?a:b;
max=(d>c)?d:c;
System.out.println(“abc中最大值是”+max);
*/
//方法三
int a,b,c,max;
a=1;
b=2;
c=3;
max=(((a>b)?a:b)>c)?((a>b)?a:b):c;
System.out.println("abc中最大值是"+max);
}
}