📌  相关文章
📜  猫和老鼠hackerrank解决方案javascript代码示例

📅  最后修改于: 2022-03-11 15:03:44.129000             🧑  作者: Mango

代码示例1
// cats and a mouse hackerrank solution javascript
function catAndMouse(x, y, z) {
        let catADist = Math.abs(x -z);
        let catBDist = Math.abs(y - z);
        if(catADist > catBDist){
            return "Cat B";
        }else if(catADist < catBDist){
            return "Cat A";
        }else{
            return "Mouse C";
        }
}