Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2480: 주사위 세계 #25

Open
minsoo0715 opened this issue Sep 25, 2023 · 0 comments
Open

2480: 주사위 세계 #25

minsoo0715 opened this issue Sep 25, 2023 · 0 comments
Assignees
Labels
#구현 구현 문제입니다. #수학 수학 문제 @백준 백준(https://www.acmicpc.net) 문제 C/C++ c/c++로 해결한 문제들

Comments

@minsoo0715
Copy link
Owner

2480: 주사위 세계

소스 코드

아이디어

if문 사용

구현

삼항연산자, if문을 통해 조건에 맞게 구현

#include <iostream>

using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, b, c;
    cin >> a >> b >> c;

    if(a == b && b == c) {
        cout << 10000 + a * 1000;
    }else if(a == b || b == c || a == c) {
        cout << 1000 + (a == b ? a : b == c ? b : a == c ? c : 0) * 100;
    }else {
        cout << max(max(a,b), c) * 100;
    }
    return 0;
}
@minsoo0715 minsoo0715 added @백준 백준(https://www.acmicpc.net) 문제 C/C++ c/c++로 해결한 문제들 #수학 수학 문제 #구현 구현 문제입니다. labels Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#구현 구현 문제입니다. #수학 수학 문제 @백준 백준(https://www.acmicpc.net) 문제 C/C++ c/c++로 해결한 문제들
Projects
None yet
Development

No branches or pull requests

1 participant