热门标签
更多>
搜索结果
查询Tags标签: numall,共有 2条记录-
蒙特卡洛法计算圆周率π(Python)
1 import random2 i = 03 numin = 04 numall = 05 while 1:6 i += 17 numall += 18 x = random.uniform(-5,5)9 y = random.uniform(-5,5) 10 if y*y+x*x <= 25: 11 numin += 1 12 if i % 50000 == 0: 13 print(4.0*numin/num…
2021/10/6 17:40:53 人评论 次浏览 -
蒙特卡洛法计算圆周率π(Python)
1 import random2 i = 03 numin = 04 numall = 05 while 1:6 i += 17 numall += 18 x = random.uniform(-5,5)9 y = random.uniform(-5,5) 10 if y*y+x*x <= 25: 11 numin += 1 12 if i % 50000 == 0: 13 print(4.0*numin/num…
2021/10/6 17:40:53 人评论 次浏览