Advertisement
mr1302

3.2

Sep 12th, 2020
1,273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.     setlocale(LC_ALL, "Rus"); // устанавливаем локаль системы, чтобы печатать русские символы
  9.     double S, p, n, m, R;
  10.     cin >> S >> n >> m;
  11.     for (int p = 1; p < 101; ++p) {
  12.         double r = p / 100;
  13.         if (m == (S * r * pow(1 + r, n)) / (12 * (pow(1 + r, n) - 1))) {
  14.             cout << r;
  15.             return 0;
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement