不用比较判断两个数大小

int max = ((a+b) + abs(a-b)) / 2; 

原文地址:https://www.cnblogs.com/hbf369/p/2672118.html