-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathProgram.cs
29 lines (24 loc) · 829 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
namespace Cats_and_a_Mouse {
class Program {
static string CatAndMouse(int x, int y, int z) {
if (Math.Abs(z - x) < Math.Abs(z - y)) {
return "Cat A";
} else if (Math.Abs(z - x) > Math.Abs(z - y)) {
return "Cat B";
} else {
return "Mouse C";
}
}
static void Main(string[] args) {
int q = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < q; i++) {
string[] xyz = Console.ReadLine().Split(' ');
int x = Convert.ToInt32(xyz[0]);
int y = Convert.ToInt32(xyz[1]);
int z = Convert.ToInt32(xyz[2]);
Console.WriteLine("{0}", CatAndMouse(x, y, z));
}
}
}
}