728x90

2480번: 주사위 세개
1에서부터 6까지의 눈을 가진 3개의 주사위를 던져서 다음과 같은 규칙에 따라 상금을 받는 게임이 있다. 같은 눈이 3개가 나오면 10,000원+(같은 눈)×1,000원의 상금을 받게 된다. 같은 눈이 2개
www.acmicpc.net
#include <iostream>
using namespace std;
int a = 0;
int b = 0;
int c = 0;
int score = 0;
int main() {
cin >> a >> b >> c;
if (a == b && b == c) {
score = 10000 + a * 1000;
}
else if (a == b || b == c || a == c) {
if (a == b) {
score = 1000 + a * 100;
}
else if (b == c) {
score = 1000 + b * 100;
}
else if (a == c) {
score = 1000 + c * 100;
}
}
else {
if (a > b && a > c) {
score = a * 100;
}
else if (b > a && b > c) {
score = b * 100;
}
else if (c > a && c > b) {
score = c * 100;
}
}
cout << score << "\n";
return 0;
}
728x90
'Algorithm > 백준' 카테고리의 다른 글
[C++] 백준 5622번: 다이얼 (0) | 2022.02.16 |
---|---|
[C++] 백준 2525번: 오븐 시계 (0) | 2022.02.15 |
[C++] 백준 4999번: 아! (0) | 2022.02.15 |
[C++] 백준 11719번: 그대로 출력하기 2 (0) | 2022.02.14 |
[C++] 백준 11718번: 그대로 출력하기 (0) | 2022.02.14 |
댓글