Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int main()
- {
- freopen("input.txt","r",stdin);
- freopen("output.txt","w",stdout);
- double s, d, n;
- cin >> s >> d >> n;
- double temp;
- if (d == 0) cout << "0\n";
- else
- {
- for (int i = 1; i <= 100; i++)
- {
- temp = s;
- for (int j = 0; j < n; j++)
- {
- temp = temp + (temp * i * 0.01);
- }
- if (temp == (s + d))
- {
- cout << i << endl;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement