Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double S, p, n, m, r, m_tmp;
- cout << "Введите S, m, n: ";
- cin >> S >> m >> n;
- for (long int i = 0; p < 100000; ++i) {
- p = i / 1000;
- r = p / 100;
- m_tmp = (S * r * pow(1+r, n)) / (12*(pow(1+r, n)-1));
- if (m_tmp > m) {
- break;
- };
- }
- cout << "Полученный процент p: " << p << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement