#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int Max(int a, int b, int c) {
if (a > b && a > c) {
return a;
}
else if (b > a && b > c) {
return b;
}
else {
return c;
}
}
int main(void) {
int money;
int a, b, c;
int check;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
if ((a == b) && (b == c)) {
money = 10000 + 1000 * a;
}
else if ((a == b) && (b != c)) {
money = 1000 + 100 * a;
}
else if ((a != b) && (b == c)) {
money = 1000 + 100 * b;
}
else if ((a == c) && (a != b)) {
money = 1000 + 100 * a;
}
else if (a != b && a != c && a != b) {
money = 100 * Max(a, b, c);
}
printf("%d", money);
return 0;
}
이렇게 풀어도 되나 싶은 정도의 노가다. c로 작성하였기에 Max함수는 따로 정의해 주었다.
다른 풀이를 보니 파이썬에는 max가 기본적으로 라이브러리에 있는듯.
다 풀고나서 보이는거지만 마지막 else if 는 else로 바꿔도 괜찮았다.
두번째~네번째 else if 또한 2개의 else if 로 줄일 수 있었음.
첫 백준풀이라 너무나도 응애스럽다.
