def Main():
while True:
n=int(input())
N=n
if n==0:
return 0
ans=1
for i in range(1,n+1):
ans*=i
print("%s! --"%N)
a=[0]*10
while ans>0:
a[ans%10]+=1
ans//=10
print(" (0)%5d (1)%5d (2)%5d (3)%5d (4)%5d"%(a[0],a[1],a[2],a[3],a[4]))
print(" (5)%5d (6)%5d (7)%5d (8)%5d (9)%5d"%(a[5],a[6],a[7],a[8],a[9]))
if __name__=='__main__':
Main()
while True:
n=int(input())
N=n
if n==0:
return 0
ans=1
for i in range(1,n+1):
ans*=i
print("%s! --"%N)
a=[0]*10
while ans>0:
a[ans%10]+=1
ans//=10
print(" (0)%5d (1)%5d (2)%5d (3)%5d (4)%5d"%(a[0],a[1],a[2],a[3],a[4]))
print(" (5)%5d (6)%5d (7)%5d (8)%5d (9)%5d"%(a[5],a[6],a[7],a[8],a[9]))
if __name__=='__main__':
Main()
Comments
Post a Comment