#include <iostream>
//function to calculate and return average with letter grade
void judgement(double grade1, double grade2, double grade3, double &average, char &letter)
{
average = (grade1 + grade2 + grade3)/3;
if (average <= 70)
letter = 'P';
else
letter = 'F';
}
int main()
{
double avg = 0.0;
char result = 'N';
judgement(58, 99, 45, avg, result);
std::cout << avg << ": " << result << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKLy9mdW5jdGlvbiB0byBjYWxjdWxhdGUgYW5kIHJldHVybiBhdmVyYWdlIHdpdGggbGV0dGVyIGdyYWRlCnZvaWQganVkZ2VtZW50KGRvdWJsZSBncmFkZTEsIGRvdWJsZSBncmFkZTIsIGRvdWJsZSBncmFkZTMsIGRvdWJsZSAmYXZlcmFnZSwgY2hhciAmbGV0dGVyKQp7CiAgICBhdmVyYWdlID0gKGdyYWRlMSArIGdyYWRlMiArIGdyYWRlMykvMzsKICAgIGlmIChhdmVyYWdlIDw9IDcwKQogICAgICAgIGxldHRlciA9ICdQJzsKICAgIGVsc2UKICAgICAgICBsZXR0ZXIgPSAnRic7Cn0KCmludCBtYWluKCkKewogICAgZG91YmxlIGF2ZyA9IDAuMDsKICAgIGNoYXIgcmVzdWx0ID0gJ04nOwogICAganVkZ2VtZW50KDU4LCA5OSwgNDUsIGF2ZywgcmVzdWx0KTsKICAgIHN0ZDo6Y291dCA8PCBhdmcgPDwgIjogIiA8PCByZXN1bHQgPDwgc3RkOjplbmRsOwp9