求助,20分

P1423 小玉在游泳

e定义了?
by YeHaiFengYC2204 @ 2023-08-09 21:39:08


@[liu12073_](/user/997339)
by YeHaiFengYC2204 @ 2023-08-09 21:39:26


@[YeHaiFengYC2204](/user/561482) sorry,忘加了,以下是我的原始代码 ```cpp #include<bits/stdc++.h> using namespace std; int main() { double s = getchar(),e = 2.0; int q = 0; while (s > 0) { e *= 0.98; s -= e; q++; } cout << q << endl; return 0; } ```
by liu12073_ @ 2023-08-09 21:41:53


@[liu12073_](/user/997339) 什么鬼,你的程序样例输出38???
by YeHaiFengYC2204 @ 2023-08-09 21:43:07


@[YeHaiFengYC2204](/user/561482) 在我电脑上输出39的
by liu12073_ @ 2023-08-09 21:43:56


大哥,别用getchar(),这东西不识别小数点
by YeHaiFengYC2204 @ 2023-08-09 21:44:01


4.3和43在它眼里一模一样
by YeHaiFengYC2204 @ 2023-08-09 21:44:33


@[YeHaiFengYC2204](/user/561482) ok,我去试试
by liu12073_ @ 2023-08-09 21:45:22


0输出34,服了你这代码
by YeHaiFengYC2204 @ 2023-08-09 21:45:56


@[liu12073_](/user/997339)
by YeHaiFengYC2204 @ 2023-08-09 21:46:07


| 下一页