Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 278 Bytes

复利公式.md

File metadata and controls

24 lines (17 loc) · 278 Bytes

复利公式

s = 0
p = input('本金:')
p = float(p)
i = input('利率:')
i = float(i)
n = input('期数:')
n = int(n)

# 复利公式:s = p(1 + i)n
s = p * (1 + i) ** n
print(s)
本金: 12
利率: 2
期数: 21


125524238436.0