Factorial Solved Problem code: FCTRL

时间:2023-03-10 01:08:54
Factorial  Solved Problem code: FCTRL
 import sys
#import psyco #很奇怪,这题用psyco就runtime error #psyco.full() def z(n): #这个应该是技巧的一种算法
r = 0
while 5 <= n:
n /= 5
r += n
return r def main():
n = int(sys.stdin.readline())
for t in sys.stdin: #这种循环输入一点问题也没
print z(int(t)) #输入的是String, 一定要记得int转化 main() #这种函数架构很科学和良好

///另一种方法

for n in map( int , sys.stdin.read().split() )[1:]: print z( n )

学习

  for t in sys.stdin 这种循环输入可以复用

  这种函数式的架构很科学

  数组初步了解,冒号的使用精髓

    [1:] 躲过了第一个元素(是数量),然后到最后一位元素

错误

  psyco()不总是能用