'commit'
This commit is contained in:
19
TangDou/XiTi/1242.cpp
Normal file
19
TangDou/XiTi/1242.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
float x;
|
||||
cin >> x;
|
||||
float pre = 2;
|
||||
float sum = 2;
|
||||
for (int i = 2;; i++) {
|
||||
sum += pre * 0.98;
|
||||
pre = pre * 0.98;
|
||||
if (sum > x) {
|
||||
cout << i << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user