1
2
3
4
5
6
7
8
9
10
11
|
def sol(n):
if len(n) == 1 : k = 1
else : k = len(n) - n.count('0')
ans=[]
for i in range(len(n)):
if n[i] !='0' : ans.append(n[i]+'0'*(len(n)-i-1))
print(k)
print(*ans)
for i in range(int(input())):
sol(str(input()))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 844. Backspace String Compare (0) | 2022.05.02 |
---|---|
leetcode 905. Sort Array By Parity (0) | 2022.05.02 |
codeforces 1335A - Candies and Two Sisters (0) | 2022.05.02 |
codeforces 1154A - Restoring Three Numbers (0) | 2022.04.29 |
codeforces 486A - Calculating Function (0) | 2022.04.29 |
댓글