17 lines
265 B
Python
17 lines
265 B
Python
def factorial(n):
|
|
if n == 1:
|
|
return 1
|
|
if n>1:
|
|
return n*factorial(n-1)
|
|
|
|
n = int(input())
|
|
|
|
show = []
|
|
for i in range(n):
|
|
nb = int(input())
|
|
answer = factorial(nb)
|
|
show.append(str(answer)[-1])
|
|
|
|
for s in show:
|
|
print(s)
|