#38498: python新手解


jun103010418@gmail.com (駿陳)

學校 : 不指定學校
編號 : 238530
來源 : [106.1.48.42]
最後登入時間 :
2024-05-03 06:58:39
c290. APCS 2017-0304-1秘密差 -- 2017年3月APCS | From: [106.1.48.42] | 發表日期 : 2023-11-30 21:03

def fly(a,b)->int:
    thens = abs(a-b)
    return thens
total = 0
c = list(input())
d = [int(c[i]) for i in range(len(c))]
b = 0
a = 0
for i in range(0,len(d),2):
    b+=d[i]
for i in range(1,len(d),2):
    a+=d[i]
ass = fly(a,b)
print(ass)

 
ZeroJudge Forum