Last Factorial Digit

This commit is contained in:
2022-05-13 21:38:21 +02:00
parent 29b85debb0
commit 94ea53c3c7

8
lastfactorialdigit.py Normal file
View File

@@ -0,0 +1,8 @@
import sys, math
t = int(sys.stdin.readline())
for _ in range(t):
n = int(sys.stdin.readline())
f = math.factorial(n)
print(f % 10)