#include "stdafx.h"
#include "stdlib.h"
int main()
{
double luck,sum;
int i=0;
luck=1000000.0;
while(luck>0)
{
luck-=100000.0-luck*0.08;
i++;
}
printf("%d\n",i);
system("pause");
return 0;
}
Chuckie Lucky 赢了100万美元,他把它存入一个每年赢得8%的帐户。在每年的最后一天,Chuckie取出 10万美元。编写一个程序,计算需要多少年Chuckie就会清空他的帐户。
最新推荐文章于 2024-07-01 21:13:15 发布