문제
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에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.