Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- fat = [0]*1000001
- fat[1] = 1
- def ignorarZero(num):
- for I in reversed(str(num)):
- if I != '0':
- return int(I)
- for I in range(2, 1000000):
- fat[I] = I*fat[I-1]
- fat[I] = fat[I]
- fat[I] = ignorarZero(fat[I])
- #rodando
- instancia = 1
- while True:
- try:
- # print("Instancia {}".format(instancia))
- n = int(input())
- print(fat[n],end=",")
- instancia+=1
- except EOFError:
- print("",end="\n")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement