AC
查看原帖
AC
776958
CodingSu楼主2024/10/29 15:04
#include<bits/stdc++.h>
using namespace std;
int point;
double ans;
double GPA(int x){
    double nes;
    if(x >= 90)
        nes = 4.0;  
    else if(x >= 60)
        nes = 4.0-(90-x)*0.1;
    else{
        x = (int)(sqrt((float)x) * 10);
        if(x >= 90)
            nes = 4.0;  
        else if(x >= 60)
            nes = 4.0-(90-x)*0.1;
        else nes = 0.0;
    }
    return nes;
}

int main(){
    cin >> point;
    ans = GPA(point);
    cout << fixed << setprecision(1) << ans << endl;
    return 0;
}
2024/10/29 15:04
加载中...