개발바닥

BOJ_2577 [ 숫자의 개수 ] [ 파이썬 ] 본문

[ Algorithm ]/[ PYTHON ]

BOJ_2577 [ 숫자의 개수 ] [ 파이썬 ]

라이언 2020. 5. 8. 16:24
반응형

문제

https://www.acmicpc.net/problem/2577

 

2577번: 숫자의 개수

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

www.acmicpc.net

문제 해결 방법

세 개의 수를 곱한 결과를 리스트형태로 저장 후 count 함수를 사용해서 개수를 출력하도록 했다.

 

 

 

 

소스 코드 보기

https://github.com/jokerKwu/BOJ_Algorithm/blob/master/python/BOJ_2577.py

 

jokerKwu/BOJ_Algorithm

Contribute to jokerKwu/BOJ_Algorithm development by creating an account on GitHub.

github.com

a = int(input())
b = int(input())
c = int(input())
res = list(str(a*b*c))
for i in range(10):
    print(res.count(str(i)))
반응형
Comments