Files
PS/swea/3750.py
2024-05-20 16:21:53 +09:00

15 lines
230 B
Python

t=int(input())
pr=[]
for tc in range(1,t+1):
n=input()
while len(n)>1:
r=0
for c in n:
v=int(c)
r+=v
n=str(r)
pr.append("#{} {}".format(tc,n))
for p in pr:
print(p)