반응형 알리즘1 (Python/🥈5)백준알고리즘 1676번: 팩토리얼 0의 개수 문제 출처:https://www.acmicpc.net/problem/1676 1676번: 팩토리얼 0의 개수 N!에서 뒤에서부터 처음 0이 아닌 숫자가 나올 때까지 0의 개수를 구하는 프로그램을 작성하시오. www.acmicpc.net 풀이: import sys input = sys.stdin.readline import math # fac_a = math.factorial(int(input())) # list_fac_a = list(map(int,str(fac_a))) list_fac_a = list(map(int,str(math.factorial(int(input())))))# 위에 두줄을 한줄로 표헌 list_fac_a.reverse() res = 0 for i in list_fac_a: if i .. 2022. 6. 1. 이전 1 다음 반응형