dartwlad

1_10

Feb 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.     float years, end_count_money, start_count_money, percent;
  8.     cout << "Enter your count of money: ";
  9.     cin >> start_count_money;
  10.  
  11.     cout << "Your percent: ";
  12.     cin >> percent;
  13.  
  14.     cout << "End count of money: ";
  15.     cin >> end_count_money;
  16.  
  17.     years = log(end_count_money/start_count_money)/log(1+percent/100);
  18.     round(years);
  19.     if(years < 100){
  20.         cout << "u need: " << years << " years to become" << end_count_money <<endl;
  21.     }
  22.     else{
  23.         cout << "u need better percent :/ ";
  24.     }
  25.  
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment