#include <stdio.h>
char calcLetterGrade (int score);
int main(void) {
printf ("%c", calcLetterGrade
(101)); return 0;
}
char calcLetterGrade (int score)
{
char result; // letter grade result
// map score to letter grade
if (score > 100)
{
result = 'I';
return result;
}
if (score >= 90)
{
result = 'A';
}
else if (score >= 80)
result = 'B';
else if (score >= 70)
result = 'C';
else if (score >= 60)
result = 'D';
else if (score >= 0 && score < 60)
result = 'F';
else
result = 'I';
return result;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpjaGFyIGNhbGNMZXR0ZXJHcmFkZSAoaW50IHNjb3JlKTsKCmludCBtYWluKHZvaWQpIHsKCXByaW50ZiAoIiVjIiwgY2FsY0xldHRlckdyYWRlKDEwMSkpOwoJcmV0dXJuIDA7Cn0KCmNoYXIgY2FsY0xldHRlckdyYWRlIChpbnQgc2NvcmUpCnsKICAgIGNoYXIgcmVzdWx0OyAvLyBsZXR0ZXIgZ3JhZGUgcmVzdWx0CgogICAgLy8gbWFwIHNjb3JlIHRvIGxldHRlciBncmFkZQogICAgaWYgKHNjb3JlID4gMTAwKQogICAgewoJcmVzdWx0ID0gJ0knOwoJcmV0dXJuIHJlc3VsdDsKICAgIH0KICAgIGlmIChzY29yZSA+PSA5MCkgCiAgICB7CiAgICAgICAgcmVzdWx0ID0gJ0EnOwogICAgfQogICAgZWxzZSBpZiAoc2NvcmUgPj0gODApIAoJcmVzdWx0ID0gJ0InOwogICAgZWxzZSBpZiAoc2NvcmUgPj0gNzApIAoJcmVzdWx0ID0gJ0MnOwogICAgZWxzZSBpZiAoc2NvcmUgPj0gNjApIAoJcmVzdWx0ID0gJ0QnOwogICAgZWxzZSBpZiAoc2NvcmUgPj0gMCAmJiBzY29yZSA8IDYwKSAKCXJlc3VsdCA9ICdGJzsKICAgIGVsc2UKCXJlc3VsdCA9ICdJJzsKCiAgICByZXR1cm4gcmVzdWx0OyAKfQo=