题目
我的代码
#include <iostream>
#include <cmath>
using namespace std;
double x, GPA;
int main()
{
cin >> x;
if (x >= 90) GPA = 4.0;
else if (x >= 60 && x <= 89)
{
GPA = 4.0 - 0.1 * (90 - x);
}
else {
x = 10 * sqrt(x);
if (x >= 90) GPA = 4.0;
else if (x >= 60 && x <= 89) GPA = 4.0 - 0.1 * (90 - x);
}
printf("%.1lf", GPA);
return 0;
}
评测记录