BAEKJOON/Python

[B2553][마지막 팩토리얼 수][python]

sseni 2021. 3. 26. 21:30
728x90

https://www.acmicpc.net/problem/2553


N = int(input())
f = 1
for i in range(1, N+1):
   f *= i
   f %= 1000000000000
   while f % 10 == 0:
        f /= 10
print(int(f % 10))
728x90