//该存多少钱
#include<stdio.h>
#include<math.h>
double money(int n)
{
if(n==5)
return 1000.0/(1+0.0063*12);
else
return (money(n+1)+1000.0)/(1+0.0063*12);//本金乘以利率乘以时间
}
int main()
{
int i;
double s=money(1);
printf("%f\n",s);
return 0;
}


注释:另解
for(i=0;i<5;i++)
toatl+=(total+1000.0)/(1+0.0063*12);

 

相关文章:

  • 2021-07-25
  • 2022-02-25
  • 2021-11-08
  • 2022-12-23
  • 2021-04-26
  • 2021-12-26
  • 2021-07-04
  • 2021-08-01
猜你喜欢
  • 2021-11-01
  • 2021-05-05
  • 2022-03-02
  • 2021-05-17
  • 2021-04-11
  • 2021-07-16
  • 2021-04-02
相关资源
相似解决方案