所以我无法弄清楚我的问题是什么输出需要类似于“结果1:55.00 P级”
我是初学者,所以在这段艰难时期的任何帮助将不胜感激,谢谢
for(int a=0;a< 10;a++)
{
cout << "Result " << a+1 << " " << score[a] << " " << determine_grade(score[a]) << "\n";
}
system("Pause");
}
char determine_grade(double a)
{
char grade;
switch(grade)
{
case(1):
if (a >100)
cout << "Invalid Input!";
case(2):
if (a >= 90)
grade = 'A';
break;
case(3):
if (a >= 70)
grade = 'B';
break;
case(4):
if (a >= 60)
grade = 'C';
break;
case(5):
if (a >= 50)
grade = 'P';
break;
default: grade = 'U';
}
cout << grade;
}