Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- float years, end_count_money, start_count_money, percent;
- cout << "Enter your count of money: ";
- cin >> start_count_money;
- cout << "Your percent: ";
- cin >> percent;
- cout << "End count of money: ";
- cin >> end_count_money;
- years = log(end_count_money/start_count_money)/log(1+percent/100);
- round(years);
- if(years < 100){
- cout << "u need: " << years << " years to become" << end_count_money <<endl;
- }
- else{
- cout << "u need better percent :/ ";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment