错两个点求助
查看原帖
错两个点求助
1040391
fox_jellyfish楼主2024/7/27 11:33
#include<bits/stdc++.h>
using namespace std;
int main()
{
    double n, m;
    cin >> n;
    if(n >= 0 && n < 5)
    {
        cout << fixed << setprecision(3) << 2.5 - n;
        return 0;
    }
    if(n >= 5 && n < 10)
    {
        cout << fixed << setprecision(3) << 2.0 - sqrt(n - 3.0) * 1.5;
        return 0;
    }
    cout << fixed << setprecision(3) << n / 2.0 - 1.5;
}
2024/7/27 11:33
加载中...