首页 > > > 求两个整型变量的最大值
有两个整型变量 a 和 b,不能使用任何判断语句,求他们当中的最大值。
#include "stdio.h"
#include "stdbool.h"
#include "math.h"
int main()
{
int a = 3;
int b = 6;
int max = ((a + b) + abs(a - b)) / 2;
printf("max:%d\n",max);
return (0);
}原文作者:;如有侵权,请联系管理员删除。