artemgf

Гномик

Apr 20th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #define _USE_MATH_DEFINES
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <set>
  6. #include <map>
  7. #include <algorithm>
  8. #include <string>
  9. #include <math.h>
  10. #include <vector>
  11. #include <cmath>
  12.  
  13. using namespace std;
  14.  
  15. int main()
  16. {
  17.     long double n, m, p, i=0;
  18.  
  19.     cin >> n >> m >> p;
  20.  
  21.     while (n > m)
  22.     {
  23.         n = n - n*(p / 100);
  24.         i++;
  25.     }
  26.  
  27.     cout << i;
  28.     _getch();
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment