a241: 第二題:1 / x 是有限小數

最後編輯:2017-01-23 建立:2016-12-28 歷史紀錄

百千.IOhttp://zerojudge.tw/ShowProblem?problemid=a241

  • def x2(i):
  • global count,n
  • if i*2<=n:
  • #print("x2",i*2)
  • count+=1
  • x5(i)
  • x2(i*2)
  • def x5(i):
  • global count,n
  • if i*5<=n:
  • #print("x5",i*5)
  • count+=1
  • x5(i*5)
  • m = int(input(''))
  • for _ in range(m):
  • n = int(input(''))
  • count = 0
  • x2(1)
  • print(count)