문제 링크입니다: https://www.acmicpc.net/problem/20839
20839번: Betygsättning
På första raden står tre heltal $1 \leq x \leq 30$, $1 \leq y \leq 30$ och $1 \leq z \leq 30$, antalet A-, C- och E-kriterier som finns. På den andra raden står tre heltal $0 \leq x' \leq x$, $0 \leq y' \leq y$ och $0 \leq z' \leq z$, antalet A-, C- o
www.acmicpc.net
간단한 구현 문제였습니다.
(생각해봐야할 포인트: int형으로 입력받았을 때 학생이 받은 점수는 0점이고 기준 점수가 1점이라면?)
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> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
double A, C, E; | |
cin >> A >> C >> E; | |
double studentA, studentC, studentE; | |
cin >> studentA >> studentC >> studentE; | |
if (studentA >= A && studentC >= C && studentE >= E) | |
{ | |
cout << "A\n"; | |
return 0; | |
} | |
if (studentA >= A / 2 && studentC >= C && studentE >= E) | |
{ | |
cout << "B\n"; | |
return 0; | |
} | |
if (studentC >= C && studentE >= E) | |
{ | |
cout << "C\n"; | |
return 0; | |
} | |
if (studentC >= C / 2 && studentE >= E / 2) | |
{ | |
cout << "D\n"; | |
return 0; | |
} | |
cout << "E\n"; | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 8426번 Stół (0) | 2021.06.26 |
---|---|
백준 22015번 金平糖 (Konpeito) (0) | 2021.06.23 |
백준 7947번 Koncert (1) | 2021.06.19 |
백준 7891번 Can you add this? (0) | 2021.06.18 |
백준 7789번 텔레프라임 (0) | 2021.06.17 |