문제 링크입니다: www.acmicpc.net/problem/17009
17009번: Winning Score
The first three lines of input describe the scoring of the Apples, and the next three lines of input describe the scoring of the Bananas. For each team, the first line contains the number of successful 3-point shots, the second line contains the number of
www.acmicpc.net
간단한 구현 문제였습니다.
This file contains 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> | |
using namespace std; | |
typedef struct | |
{ | |
int three, two, one; | |
}Score; | |
int getScore(Score score) | |
{ | |
int result = score.three * 3 + score.two * 2 + score.one; | |
return result; | |
} | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
Score Apples, Bananas; | |
cin >> Apples.three >> Apples.two >> Apples.one; | |
cin >> Bananas.three >> Bananas.two >> Bananas.one; | |
int appleScore = getScore(Apples); | |
int bananaScore = getScore(Bananas); | |
if (appleScore > bananaScore) | |
{ | |
cout << "A\n"; | |
} | |
else if (appleScore < bananaScore) | |
{ | |
cout << "B\n"; | |
} | |
else | |
{ | |
cout << "T\n"; | |
} | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 17388번 와글와글 숭고한 (0) | 2021.03.26 |
---|---|
백준 17362번 수학은 체육과목 입니다 2 (0) | 2021.03.26 |
백준 16785번 ソーシャルゲーム (0) | 2021.03.26 |
백준 16727번 ICPC (0) | 2021.03.26 |
백준 16693번 Pizza Deal (0) | 2021.03.25 |