Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ude <iostream>
- #include <algorithm>
- using namespace std;
- int solve(double M, int T, double r)
- {
- int m = M, t=0;
- while(m < 2*M) {
- m += r*m;
- t += T;
- }
- return t;
- }
- int main()
- {
- int t;
- double m, r;
- cin >> m >> t
- >> r;
- cout << solve(m, t, r/(double)100 ) << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement