求煮——选官

P1426 小鱼会有危险吗

```cpp #include <stdio.h> #include <iostream> using namespace std; int main() { double a, b, c = 7, s = 0; scanf("%llf%llf", &a, &b); while (1) { if (s >= a - b) { if (c * 0.98 >= 2 * b)<- 这里 { puts("n"); } else puts("y"); return 0; } s += c; c *= 0.98; } return 0; } ```
by _Clown__ @ 2023-11-08 17:02:42


@[IOI_ILJYT](/user/902351)
by _Clown__ @ 2023-11-08 17:02:53


@[ng_bf](/user/593499) WA了
by IOI_ILJYT @ 2023-11-08 17:09:44


输入llf改成lf试试 @[IOI_ILJYT](/user/902351)
by _Clown__ @ 2023-11-08 17:11:25


@[ng_bf](/user/593499) 我改了输入就行了: ```cpp #include <stdio.h> #include <iostream> using namespace std; int main() { double a, b, c = 7, s = 0; cin >>a >> b; while (1) { if (s >= a - b) { s += c; if (s > a + b) { puts("n"); } else puts("y"); return 0; } s += c; c *= 0.98; } return 0; } ``` but,thx
by IOI_ILJYT @ 2023-11-08 17:12:13


|