데굴데굴

[파이썬] 2577번: 숫자의 개수 본문

algorithm/백준

[파이썬] 2577번: 숫자의 개수

aemaaeng 2022. 3. 15. 19:38

 

 

2577번: 숫자의 개수

첫째 줄에 A, 둘째 줄에 B, 셋째 줄에 C가 주어진다. A, B, C는 모두 100보다 크거나 같고, 1,000보다 작은 자연수이다.

www.acmicpc.net

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

n = list(map(int, str(a * b * c)))

for i in range(10):
    print(n.count(i))

혹은 이렇게 해도 된다.

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

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

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

 

'algorithm > 백준' 카테고리의 다른 글

[파이썬] 11654번: 아스키 코드  (0) 2022.03.19
[파이썬] 3052번: 나머지  (0) 2022.03.15
[파이썬] 2562번: 최댓값  (0) 2022.03.15
[파이썬] 10818번: 최소, 최대  (0) 2022.03.15
[파이썬] 10952번: A+B - 5  (0) 2022.03.13
Comments