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 m, d, n;
- cin >> m >> d >> n;
- while (p < m)
- {
- denovi++;
- p += d;
- if (p >= m)
- {
- cout << denovi << endl;
- break;
- }
- p -= n;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement