新浪博客 发表时间 -- 2009-07-27 16:38:21)
题目:
Suppose you open a savings account with a certain initial balance. You will not make any withdrawals or further deposits for a number of years. The bank will compound your balance (add the annual interest) once a year, on the anniversary of the opening of the account. Your goal is to achieve a certain target amount in your savings account.
In how may years will the target amount be achieved?
In how may years will the target amount be achieved?
Input:
The target amount will be greater than the initial balance. The input is terminated by end-of-file
Outp:
数据......
Sample Input:
Sample Output:
算法:
P为总金额,r为每年的利润率,S为本金..有这公式就好办了...
代码:
int main()
{
}