class Demo{
public static void main(String[] args){
int a = 1;
int b = 2;
int c = 3;
int max = (((a > b) ? a : b) > c) ? ((a > b) ? a : b) : c;
System.out.println("最大值为" + max);
class Max{
public static void main(String [] args){
int a = 10;
int b = 20;
int c = 30;
if (a>b & a>c){
System.out.println(a);
} else if (b>a & b>c) {
System.out.println(b);
}else
System.out.println(c);
}
}
public class Test11 {
public static void main(String[] args) {
int x = 231,y=307,z=342;
int temp;
temp = x>y?x:y;
int max;
if(temp<z) {
max = z;
}else{
max = temp;
}
System.out.println("最大值为:"+max);
}
}