计算复合利息:农夫约翰的投资收益
m=eval(input('约翰现在有的钱数:')) r=eval(input('复合年利率:')) n=int(input('约翰投资的年数:'))
s=m for i in range(1,n+1): s=s*(1+r)
print('{}年后约翰将有{}元'.format(n,int(s)))
原文地址: https://www.cveoy.top/t/topic/oKgC 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
m=eval(input('约翰现在有的钱数:')) r=eval(input('复合年利率:')) n=int(input('约翰投资的年数:'))
s=m for i in range(1,n+1): s=s*(1+r)
print('{}年后约翰将有{}元'.format(n,int(s)))
原文地址: https://www.cveoy.top/t/topic/oKgC 著作权归作者所有。请勿转载和采集!