class TestSanYuan { public static void main(String[] args) { int i=10; int j=20; int max=(i>j)? i:j; String str = (i>j)? "i大":(i==j)? "相等":"j大"; System.out.println(max); System.out.println(str); if(i>j){ System.out.println("较大值为:"+i); }else{ System.out.println("较大值为:"+j); } } }
原文地址:http://9815936.blog.51cto.com/9805936/1600098