H E E 2022. 5. 20. 14:04
728x90

2577번 - 숫자의 개수 ( https://www.acmicpc.net/problem/2577 )

 

주석 O

# 입력
a = int(input())
b = int(input())
c = int(input())

# a, b, c 를 곱한 값을 배열로 만들기
arr = list(str(a * b * c))

# 0~9 까지 반복
for i in range(10) :
    # 0~9 까지의 숫자가 몇개 있는지 string으로 변환하여 같은 문자 count
    print(arr.count(str(i)))

 

주석 X

a = int(input())
b = int(input())
c = int(input())

arr = list(str(a * b * c))

for i in range(10) :
    print(arr.count(str(i)))

 

728x90
반응형