题解 | #游游的整数切割#(Python3)
游游的整数切割
https://www.nowcoder.com/practice/c01b07fe9623425a806c85cdb6f0e0f7
# 遍历所有可以切割的位置即可
# 需要注意,在任何位置切割,都是与最末尾的数相加
s = input()
ans = 0
n = len(s)
for i in range(0, n-1):
if((int(s[i])+int(s[-1]))%2==0):
ans += 1
print(ans)
#15天刷题#