-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA. Fox And Snake.cs
37 lines (32 loc) · 925 Bytes
/
A. Fox And Snake.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
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
bool legs = false;
var init = Console.ReadLine().Split(' ').ToList();
var inDist = init.Distinct().ToList();
for (int i = 0; i < init.Distinct().Count(); i++)
{
if (init.Where(x => x == inDist[i]).Count() == 4)
{
init.RemoveAll(x => x == inDist[i]);
legs = true;
break;
}
}
if (legs == false)
{
Console.WriteLine("Alien");
return;
}
Console.WriteLine(init[0] == init[1] ? "Elephant" : "Bear");
Console.ReadLine();
}
}
}