問題
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用に調整されています。上記の説明と制約に従ってください。