public class demo08 { public static void main(String[] args) { int a = 20, b = 30, c = 40; int d = (a>b) ? 20 : 30; int max = (d>c) ? 30 : 40; System.out.println(max+"是最大值"); }}