C++小玉游泳问题
题目是这样的:我的解题方法:
//Author:PanDaoxi (File 1)
#include <iostream>
using namespace std;
int main(){
double m,step;
cin >> m;
int n;
step = 2;
while (m > 0){
n += 1;
step *= 0.98;
m -= step;
}
cout << n << endl;
return 0;
}
https://blog.51cto.com/u_15467636/4869148
页:
[1]