आसान 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 के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।

दूसरों से सीखें

समुदाय समाधान

अभी तक कोई प्रकाशित समाधान नहीं। पहला साझा करने के लिए इस चुनौती को हल करें।