Last Factorial Digit
This commit is contained in:
1 parent
29b85debb0
commit
94ea53c3c7
1 file changed
+8
@@ -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