Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int p = 0;
- int denovi = 0;
- int h, u, d;
- cin >> h >> u >> d;
- while (p < h)
- {
- denovi++;
- p += u;
- if (p >= h)
- {
- cout << denovi << endl;
- break;
- }
- p -= d;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement