Last Factorial Digit
This commit is contained in:
8
lastfactorialdigit.py
Normal file
8
lastfactorialdigit.py
Normal 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)
|
||||
Reference in New Issue
Block a user