题目链接
水的不忍直视啊。。。
#include <iostream> using namespace std; int main() { int n, u, d, t; while (cin >> n >> u >> d&&n) { t = 0; while (1){ n -= u; t++; if (n <= 0) break; n += d; t++; } cout << t << endl; } return 0; }
水的不忍直视啊。。。
#include <iostream> using namespace std; int main() { int n, u, d, t; while (cin >> n >> u >> d&&n) { t = 0; while (1){ n -= u; t++; if (n <= 0) break; n += d; t++; } cout << t << endl; } return 0; }