You are viewing a single comment's thread. Return to all comments →
Easy C# Solution
static string catAndMouse(int x, int y, int z) { int catADistance = 0; int catBDistance = 0; if(x < z) { catADistance = z - x; } if(y < z) { catBDistance = z - y; } if(x > z) { catADistance = x - z; } if(y > z) { catBDistance = y - z; } if(catADistance > catBDistance) { return "Cat B"; } if(catBDistance > catADistance) { return "Cat A"; } else { return "Mouse C"; }
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
Easy C# Solution