if( (a-b)*(b-c)>0 ) return b; else if( (b-a)*(a-c)>0 ) return a; else return c; 只用两次比较,得到三个数的中间值。 转载于:https://www.cnblogs.com/feng18/p/6897303.html