计算100的阶乘
100的阶乘可以表示为100!,计算方法如下:
100! = 100 * 99 * 98 * ... * 2 * 1
使用循环或递归的方式可以计算出100的阶乘。下面是使用循环的方法:
factorial = 1
for i in range(2, 101):
factorial *= i
print(factorial)
计算结果为:
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
原文地址: https://www.cveoy.top/t/topic/igfx 著作权归作者所有。请勿转载和采集!