http://www.blogjava.net/Jack2007/archive/2009/01/19/251984.html
从这Blog中看到这样一个算法
private static int min(int oneValue, int twoValue, int threeValue) {
return oneValue > twoValue ? twoValue
: oneValue > threeValue ? threeValue : oneValue;
}
其目的是为了获得三个数的最小值,
不过当用例为5 3 2也就是z<y<x时 输出为3 其原因就是因为> :语句由右向左执行 所以导致了问题分析的不全面性
可以修改为
x > (y > z ? z : y) ? (y > z ? z : y):x;