• + 0 comments

    // Complete the catAndMouse function below.

    static string catAndMouse(int x, int y, int z) {
    
        int mouseToCatA = int.Abs(x - z);
        int mouseToCatB = int.Abs(y - z);
    
        if(mouseToCatA == mouseToCatB)
        {
            return "Mouse C";
        }
        else if(mouseToCatA < mouseToCatB)
        {
            return "Cat A";
        }
        else return "Cat B";
    
    }