40分求助
查看原帖
40分求助
741732
small_Dongpo楼主2023/2/16 19:01

我的代码:

#include <iostream>
using namespace std;

int main()
{
    double s, f, x = 0, v = 7;
    cin >> s, f;
    double y = s + f;
    s -= f;
    while (x < s)
    {
        x += v;
        v *= 0.98;
        if (x > y)
        {
            cout << "n";
            return 0;
        }
    }
    x += v;
    if (x > y) cout << "n";
    else cout << "y";
    return
2023/2/16 19:01
加载中...