难度:简单
编写一个方法,找出两个数字a和b中最大的那一个。不得使用if-else或其他比较运算符。
输入: a = 1, b = 2
输出: 2
export function maximum(a: number, b: number): number {
return Math.max(a, b)
}
难度:简单
编写一个方法,找出两个数字a和b中最大的那一个。不得使用if-else或其他比较运算符。
输入: a = 1, b = 2
输出: 2
export function maximum(a: number, b: number): number {
return Math.max(a, b)
}