标签:put class pre return 基本数据 eva col src div
1 u = pow(1.001, 365) 2 d = pow(0.999, 365) 3 print("天天向上{:.2f},天天向下{:.2f}".format(u, d))
1 x = eval(input()) 2 du = pow(1 + x, 365) 3 dd = pow(1 - x, 365) 4 print("进步{:.3f},退步{:.2f}".format(du, dd))
1 print("天天向上的力量3") 2 dayup = 1.0 3 delta = 0.01 4 for i in range(365): 5 if i % 7 in [6, 0]: 6 dayup *= (1 - delta) 7 else: 8 dayup *= (1+delta) 9 print(dayup)
1 def du(df): 2 dayup1 = 1 3 for i in range(365): 4 if i % 7 in [6, 0]: 5 dayup1 *= (1 - 0.01) 6 else: 7 dayup1 *= (1 + df) 8 return dayup1 9 df = 0.01 10 while (du(df)) < pow(1.01, 365): 11 df += 0.001 12 print("ans={:.6f}".format(df))
标签:put class pre return 基本数据 eva col src div
原文地址:https://www.cnblogs.com/Calculus9/p/12540220.html