문제 링크입니다: www.acmicpc.net/problem/5543
5543번: 상근날드
입력은 총 다섯 줄이다. 첫째 줄에는 상덕버거, 둘째 줄에는 중덕버거, 셋째 줄에는 하덕버거의 가격이 주어진다. 넷째 줄에는 콜라의 가격, 다섯째 줄에는 사이다의 가격이 주어진다. 모든 가
www.acmicpc.net
제일 싼 햄버거와 제일 싼 음료수를 더한 값에서 50을 빼주면 원하는 답을 얻을 수 있습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
int topBurger, middleBurger, bottomBurger, cola, cider; | |
cin >> topBurger >> middleBurger >> bottomBurger >> cola >> cider; | |
int result = min(topBurger, min(middleBurger, bottomBurger)) + min(cola, cider) - 50; | |
cout << result << "\n"; | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 5893번 17배 (0) | 2021.03.11 |
---|---|
백준 5596번 시험 점수 (0) | 2021.03.11 |
백준 5575번 타임 카드 (0) | 2021.03.11 |
백준 4299번 AFC 윔블던 (2) | 2021.03.09 |
백준 3004번 체스판 조각 (3) | 2021.03.09 |