Advertisement
Josif_tepe

Untitled

Oct 22nd, 2021
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int p = 0;
  8.     int denovi = 0;
  9.     int m, d, n;
  10.     cin >> m >> d >> n;
  11.     while (p < m)
  12.     {
  13.         denovi++;
  14.         p += d;
  15.         if (p >= m)
  16.         {
  17.             cout << denovi << endl;
  18.             break;
  19.         }
  20.         p -= n;
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement