三数最大值

示例代码如下:


public class HelloWorld{
	public static void main (String args[]){
		int a = 6;
		int b = 5;
		int c = 8;

		// int temp = a > b ? a : b;
		// int max = temp > c ? temp : c;

		int max =  (a > b ? a : b) > c ? (a > b ? a : b) : c;

		System.out.println(max);

	}
}
posted @ 2021-04-02 17:30  程序员陈师兄cxycsx  阅读(51)  评论(0)    收藏  举报