1、问题
There are two int variables: a and b, don‘t use "if"、"? :"、"switch" or other judgement statement, find out the biggest one of the two numbers.
(有两个变量a和b,不用“if”、“? :”、“switch”或其他判断语句,找出两个数中比较大的)
2、算法
int max = ( (a+b) + abs(a-b) ) / 2 ;
时间: 2024-10-03 21:53:33