728x90
반응형
단순 사칙연산 문제이다. 매우 귀찮은 문제였다... end를 잘못 사용해서 10번 정도 틀렸다.
from math import factorial
while 1:
n = int(input())
if n == 0:
break
_ = input()
print(f"{n}! --")
res = str(factorial(n))
li = [res.count(str(i)) for i in range(10)]
for i in range(2):
for j in range(5):
if j == 0:
print(" (%d)%5d" % (5*i + j, li[5*i + j]), end='')
else:
print(" (%d)%5d" % (5*i + j, li[5*i + j]), end = '')
print(' ')
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 6721번 Backward number(python) (0) | 2021.03.09 |
---|---|
백준 알고리즘 6502번 동혁 피자(python) (0) | 2021.03.09 |
백준 알고리즘 6367번 Color Me Less(python) (0) | 2021.03.09 |
백준 알고리즘 1459번 걷기(python) (0) | 2021.03.09 |
백준 알고리즘 1408번 24(python) (0) | 2021.03.09 |