You are viewing a single comment's thread. Return to all comments →
java 8:
static String catAndMouse(int x, int y, int z) { if(Math.abs(x - z) < Math.abs(y-z)){ return "Cat A"; } else if (Math.abs(x - z) > Math.abs(y-z)){ return "Cat B"; } else{ return "Mouse C"; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
java 8: