쉬움 0명 해결 정답률 0%

Letter Grade

Turn a test score into a letter grade.

문제

Convert a score from 0 to 100 into a letter grade: 90 and above is A, 80–89 is B, 70–79 is C, 60–69 is D, and below 60 is F.

Implement letter_grade(score).

Input

score: The test score.

Output

Return the letter as a one-character string.

제약 조건

0 ≤ score ≤ 100

예시

예시 1
입력:
score = 85

예상 출력:
expected = "B"
입력:
long long score = 85;

예상 출력:
std::string expected = "B";
입력:
long score = 85;

예상 출력:
string expected = "B";

설명

85 is at least 80 but below 90, so the grade is B.

예시 2
입력:
score = 59

예상 출력:
expected = "F"
입력:
long long score = 59;

예상 출력:
std::string expected = "F";
입력:
long score = 59;

예상 출력:
string expected = "F";

설명

59 is below 60, so the grade is F.

참고 자료

이 문제는 CodeUtility에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.

다른 사람의 풀이 보기

커뮤니티 솔루션

아직 공개된 풀이가 없습니다. 문제를 풀고 첫 풀이를 공유하세요.