Advertisement
Josif_tepe

Untitled

Feb 16th, 2024
831
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int h, u, d;
  7.     cin >> h >> u >> d;
  8.    
  9.    
  10.     int denovi = 1;
  11.    
  12.     for(int zhelka = 0; zhelka + u < h; zhelka += u) {
  13.         denovi += 1;
  14.        
  15.         zhelka -= d;
  16.     }
  17.     cout << denovi << endl;
  18.     return 0;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement