按要求写出表达式(java)

来源:百度知道 编辑:UC知道 时间:2024/05/26 05:11:48
判断变量a是否是三个变量a、b、c中的最大者
表达式,谢谢,最好是一行解决,最好不用if

System.out.println(((a > b) && (a > c)) ? "yes" : "no");

if(a>b&&a>c)
{
System.out.print("yes");
}
else
{
System.out.print("no");
}

class test {

public static void main(String[] args){
int a = 10 ,b = 5 ,c = 2 ;

System.out.println ( a>b&&a>c ? " a is biggest !!! " : "a is not biggest!!!" ) ;
}
}