Files
PS/swea/1289.py
2024-05-08 17:17:13 +09:00

17 lines
287 B
Python

t=int(input())
for tc in range(1,t+1):
s=input()
isZero=True
count=0
for i in s:
if i=='0' and not(isZero):
isZero=True
count+=1
elif i=='1' and isZero:
isZero=False
count+=1
print("#"+str(tc),count)