復利理財源碼
發布時間: 2023-07-31 14:48:16
Ⅰ 用C#編輯一個復利計算程序
復利是指利滾利吧?
如存入1000,年利息0.003,存了10年,則調用fl(0.003,1000,10);
double fl(double rate,double cash,int times)
{
double ret = 0;
for (int i = 1; i <= times;i++ )
{
ret += Math.Pow((1 + rate), i);
}
ret *= cash;
return ret;
}
熱點內容