# 第9课 刺桐小铺增长模型
# 本金为正数，年增长率固定为非负数，年数为非负整数；不追加、不取出，全部增长金额留在模型内。
principal = 1000
rate = 0.20
years = 60
balance = principal
for year in range(years):
    balance = balance * (1 + rate)
print("期末金额", round(balance, 2), "元")
print("约为本金的", round(balance / principal, 2), "倍")
linear = principal + principal * rate * years
print("按初始本金计算固定增量时", linear, "元")
