#include <iostream>
#include <limits>
using namespace std;
int main()
{
cout << "Digite uma letra (A-F): " << endl;
char grade;
while ((grade = cin.get()) != EOF)
{
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
switch ( grade )
{
case 'A':
case 'a':
cout << "A" << endl;
break;
case 'B':
case 'b':
cout << "B" << endl;
break;
case 'C':
case 'c':
cout << "C" << endl;
break;
case 'D':
case 'd':
cout << "D" << endl;
break;
case 'F':
case 'f':
cout << "F" << endl;
break;
default:
cout << "Incorrect letter grade entered." << " Enter a new grade." << endl;
break;
}
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGltaXRzPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAppbnQgbWFpbigpCnsKCWNvdXQgPDwgIkRpZ2l0ZSB1bWEgbGV0cmEgKEEtRik6ICIgPDwgZW5kbDsKCgkKCWNoYXIgZ3JhZGU7CgkKCXdoaWxlICgoZ3JhZGUgPSBjaW4uZ2V0KCkpICE9IEVPRikKCXsKCQljaW4uaWdub3JlKHN0ZDo6bnVtZXJpY19saW1pdHM8c3RkOjpzdHJlYW1zaXplPjo6bWF4KCksICdcbicpOwoJCXN3aXRjaCAoIGdyYWRlICkKICAgICAgICB7CiAgICAgICAgCWNhc2UgJ0EnOgogICAgICAgICAgICBjYXNlICdhJzoKICAgICAgICAgICAgICAgY291dCA8PCAiQSIgPDwgZW5kbDsKICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0InOgogICAgICAgICAgICBjYXNlICdiJzoKICAgICAgICAgICAgICAgY291dCA8PCAiQiIgPDwgZW5kbDsKICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0MnOgogICAgICAgICAgICBjYXNlICdjJzoKICAgICAgICAgICAgICAgY291dCA8PCAiQyIgPDwgZW5kbDsKICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0QnOgogICAgICAgICAgICBjYXNlICdkJzoKICAgICAgICAgICAgICAgY291dCA8PCAiRCIgPDwgZW5kbDsKICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ0YnOgogICAgICAgICAgICBjYXNlICdmJzoKICAgICAgICAgICAgICAgY291dCA8PCAiRiIgPDwgZW5kbDsKICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgIGNvdXQgPDwgIkluY29ycmVjdCBsZXR0ZXIgZ3JhZGUgZW50ZXJlZC4iIDw8ICIgRW50ZXIgYSBuZXcgZ3JhZGUuIiA8PCBlbmRsOwogICAgICAgICAgICAgICBicmVhazsKICAgIH0KCQkKCX0KfQ==