#include <stdio.h>
char calcLetterGrade (int num_grade);
int main(void) {
calcLetterGrade(90);
return 0;
}
char calcLetterGrade (int num_grade)
{
char letterGrade;
if ( num_grade >= 90 && num_grade <= 100 ){
letterGrade="A";
}
else if ( num_grade >= 80 && num_grade <= 89 ){
letterGrade="B";
}
else if ( num_grade >= 70 && num_grade <= 79 ){
letterGrade="C";
}
else if ( num_grade >= 60 && num_grade <= 69 ){
letterGrade="D";
}
else if ( num_grade >= 0 && num_grade <= 59 ){
letterGrade="F";
}
else if ( num_grade > 100 && num_grade < 0 ){
letterGrade="I";
}
return letterGrade;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmNoYXIgY2FsY0xldHRlckdyYWRlIChpbnQgbnVtX2dyYWRlKTsKCmludCBtYWluKHZvaWQpIHsKCWNhbGNMZXR0ZXJHcmFkZSg5MCk7CglyZXR1cm4gMDsKfQoKY2hhciBjYWxjTGV0dGVyR3JhZGUgKGludCBudW1fZ3JhZGUpCnsKICAgY2hhciBsZXR0ZXJHcmFkZTsKICAgIAogICAgaWYgKCBudW1fZ3JhZGUgPj0gOTAgJiYgbnVtX2dyYWRlIDw9IDEwMCApewogICAgICAgIGxldHRlckdyYWRlPSJBIjsKICAgIH0KICAgIGVsc2UgaWYgKCBudW1fZ3JhZGUgPj0gODAgJiYgbnVtX2dyYWRlIDw9IDg5ICl7CiAgICAgICAgbGV0dGVyR3JhZGU9IkIiOwogICAgfQogICAgZWxzZSBpZiAoIG51bV9ncmFkZSA+PSA3MCAmJiBudW1fZ3JhZGUgPD0gNzkgKXsKICAgICAgICBsZXR0ZXJHcmFkZT0iQyI7CiAgICB9CiAgICBlbHNlIGlmICggbnVtX2dyYWRlID49IDYwICYmIG51bV9ncmFkZSA8PSA2OSApewogICAgICAgIGxldHRlckdyYWRlPSJEIjsKICAgIH0KICAgIGVsc2UgaWYgKCBudW1fZ3JhZGUgPj0gMCAmJiBudW1fZ3JhZGUgPD0gNTkgKXsKICAgICAgICBsZXR0ZXJHcmFkZT0iRiI7CiAgICB9CiAgICBlbHNlIGlmICggbnVtX2dyYWRlID4gMTAwICYmIG51bV9ncmFkZSA8IDAgKXsKICAgICAgICBsZXR0ZXJHcmFkZT0iSSI7CiAgICB9CiAgICByZXR1cm4gbGV0dGVyR3JhZGU7Cgp9IA==