add: swea/1289.py
This commit is contained in:
16
swea/1289.py
Normal file
16
swea/1289.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
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)
|
||||||
Reference in New Issue
Block a user