if마다 Console.WriteLine을 쓰지않고 money를 만들어주었다.
using System;
public class bj2480
{
public static void Main(string[] args)
{
String[] dice = Console.ReadLine().Split();
int a = int.Parse(dice[0]);
int b = int.Parse(dice[1]);
int c = int.Parse(dice[2]);
int money=0;
if (a==b && a==c && b==c){
money = 10000+a*1000;
}
else if (a==b){
money = 1000+a*100;
}
else if (a==c){
money = 1000+a*100;
}
else if (c==b){
money = 1000+b*100;
}
else {
if (a > b && a > c){
money = 100 * a;
}
else if (b > c){
money = 100 * b;
}
else {
money = 100 * c;
}
}
Console.WriteLine($"{money}");
}
}
'C# > C# (백준)' 카테고리의 다른 글
[C#] 백준 알고리즘 10950번, A+B - 3 (0) | 2022.07.25 |
---|---|
[C#] 백준 알고리즘 2739번, 구구단 (0) | 2022.07.25 |
[C#] 백준 알고리즘 2884번, 오븐 시계 (0) | 2022.07.21 |
[C#] 백준 알고리즘 2884번, 알람 시계 (0) | 2022.07.20 |
[C#] 백준 알고리즘 14681번, 사분면 고르기 (0) | 2022.07.19 |