Respuesta :

tonb
cin is discouraged, so I'd go with:

string math, physics;
getline(cin, math);
getline(cin, physics);

of course, parsing needs to happen to verify that a correct grade was typed...