You are viewing a single comment's thread. Return to all comments →
Here is the solution for C#
int res = Comparer.Default.Compare(Math.Abs(x-z),Math.Abs(y-z)); return res < 0 ? "Cat A" : res > 0 ? "Cat B" : "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 →
Here is the solution for C#
int res = Comparer.Default.Compare(Math.Abs(x-z),Math.Abs(y-z));
return res < 0 ? "Cat A" : res > 0 ? "Cat B" : "Mouse C";