Advertisement
jusohatam

Untitled

Sep 24th, 2020
1,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double S, p, n, m, r, m_tmp;
  8.     cout << "Введите S, m, n: ";
  9.     cin >> S >> m >> n;
  10.     for (long int i = 0; p < 100000; ++i) {
  11.         p = i / 1000;
  12.         r = p / 100;
  13.         m_tmp = (S * r * pow(1+r, n)) / (12*(pow(1+r, n)-1));
  14.         if (m_tmp > m) {
  15.             break;
  16.         };
  17.     }
  18.     cout << "Полученный процент p: " << p << "\n";
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement