#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
double s, d = 2.0, sum = 0.0;
int c = 0;
cin >> s;
while (1) {
if (sum >= s) {
break;
}
sum += d;
d *= 0.98;
c ++;
}
cout << c << endl;
return 0;
}
难点是while循环里的逻辑判断式,if语句可以要也可以不要。
763

被折叠的 条评论
为什么被折叠?



