#2~~#5 WA

P1423 小玉在游泳

@[ht20110603](/user/731726) 求关注 ```cpp #include <bits/stdc++.h> using namespace std; int main() { double x; cin >> x; cout << ceil(log(1 - x / 100) / log(0.98)); return 0; } ```
by JustinXiaoJunyang @ 2022-08-02 17:04:51


```b-a;``` $\downarrow$ ```b-=a;```
by ajahjahah @ 2022-08-02 17:04:52


@[ht20110603](/user/731726) `b-a;`这个语法没什么意义,只不过是算了一个值,然后就没动静了,如果想把这个值传递给b的话那么有两种写法:`b=b-a;`和`b-=a`两种语法代表同一个意思,
by ShouZheng_Observer @ 2022-08-02 17:20:03


@[PhantomKnight](/user/681349) 改了全WA???
by ht20110603 @ 2022-08-02 17:34:03


@[ht20110603](/user/731726) 啊……那我再看看哈
by ShouZheng_Observer @ 2022-08-02 17:37:18


```cpp #include<bits/stdc++.h> using namespace std; int main(){ double n,a=2,b=0,su=0; cin>>n; b=n; for(int i=0;i<n;i++){ if(b>0){ su++; b-=a; a*=0.98; } } cout<<su; return 0; } ``` 这样的话是80分
by ShouZheng_Observer @ 2022-08-02 17:44:58


使用while循环就可以了
by Syncc @ 2022-08-15 13:15:28


|