1에서부터 6까지의 눈을 가진 3개의 주사위를 던져서 다음과 같은 규칙에 따라 상금을 받는 게임이 있다.
1.같은 눈이 3개가 나오면 10,000원+(같은 눈)×1,000원의 상금을 받게 된다.
2.같은 눈이 2개만 나오는 경우에는 1,000원+(같은 눈)×100원의 상금을 받게 된다.
3.모두 다른 눈이 나오는 경우에는 (그 중 가장 큰 눈)×100원의 상금을 받게 된다.
예를 들어, 3개의 눈 3, 3, 6이 주어지면 상금은 1,000+3×100으로 계산되어 1,300원을 받게 된다. 또 3개의 눈이 2, 2, 2로 주어지면 10,000+2×1,000 으로 계산되어 12,000원을 받게 된다. 3개의 눈이 6, 2, 5로 주어지면 그중 가장 큰 값이 6이므로 6×100으로 계산되어 600원을 상금으로 받게 된다.
3개 주사위의 나온 눈이 주어질 때, 상금을 계산하는 프로그램을 작성 하시오.
namespace BaekJoon
{
public class P2480
{
int first;
int second;
int third;
public P2480(int first, int second, int third)
{
this.first = first;
this.second = second;
this.third = third;
}
void prize()
{
if (first == second || second == third || third == first)
{
if(first == second && first == third) { Console.WriteLine(10000 + first * 1000); } // 1 == 2 == 3
else if (second == first || second == third) { Console.WriteLine(1000 + second * 100); } // 1 == 2 / 2==3
else Console.WriteLine(1000 + first * 100); // 1 == 3
}
else Console.WriteLine(100 * Math.Max(first, Math.Max(third, second)));
}
static void Main(string[] args)
{
string s = Console.ReadLine();
string[] ss = s.Split();
P2480 p = new P2480(int.Parse(ss[0]), int.Parse(ss[1]), int.Parse(ss[2]));
p.prize();
}
}
}