← Back to List

7489번: 팩토리얼 ↗

Solutions

Python 3
137 B | 137 chars
from math import factorial as f
for t in range(int(input())):
    k = f(int(input()))
    while(k%10 ==0):
        k//=10
    print(k%10)