fork download
  1. n = int(input("숫자를 입력하세요: "))
  2. num = [0] * 10
  3.  
  4. while n > 0:
  5. digit = n % 10
  6. num[digit] += 1
  7. n //= 10
  8.  
  9. result = [0] * 10
  10. for i in range(1, 10):
  11. for j in range(len(str(n))):
  12. if int(str(n)[j]) >= i:
  13. result[i] += 1
  14. result[i] += 10**j
  15.  
  16. print(result)
  17.  
Success #stdin #stdout 0.03s 9836KB
stdin
11
stdout
숫자를 입력하세요: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]