From b13d2171c8c15b8c6841b2ffac0c63e558cac914 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Wed, 8 May 2024 17:17:13 +0900 Subject: [PATCH] add: swea/1289.py --- swea/1289.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 swea/1289.py diff --git a/swea/1289.py b/swea/1289.py new file mode 100644 index 0000000..ecbef88 --- /dev/null +++ b/swea/1289.py @@ -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)