标签:
1 import sys 2 #import psyco #很奇怪,这题用psyco就runtime error 3 4 5 #psyco.full() 6 7 8 def z(n): #这个应该是技巧的一种算法 9 r = 0 10 while 5 <= n: 11 n /= 5 12 r += n 13 return r 14 15 16 def main(): 17 n = int(sys.stdin.readline()) 18 for t in sys.stdin: #这种循环输入一点问题也没 19 print z(int(t)) #输入的是String, 一定要记得int转化 20 21 main() #这种函数架构很科学和良好
///另一种方法
1 for n in map( int , sys.stdin.read().split() )[1:]: 2 print z( n )
学习
for t in sys.stdin 这种循环输入可以复用
这种函数式的架构很科学
数组初步了解,冒号的使用精髓
[1:] 躲过了第一个元素(是数量),然后到最后一位元素
错误
psyco()不总是能用
Factorial Solved Problem code: FCTRL
标签:
原文地址:http://www.cnblogs.com/sangocare/p/4477027.html