#include <cmath>
int cal_max(const int &a, const int &b)
{
int c;
c = (a+b+abs(a-b))/2;
return c;
}
int cal_max_2(const int &a, const int &b)
{
bool c=false;
c = (bool)((unsigned int)(a-b) >> (sizeof(int)*8-1));
return c? b:a;
}
#define cal_max_3(a,b) (((a)>(b))? (a):(b))
求两个数的最大值
最新推荐文章于 2022-01-14 21:58:34 发布