题解 | #游游的整数切割#
游游的整数切割
https://www.nowcoder.com/practice/c01b07fe9623425a806c85cdb6f0e0f7
s = input() ''' 奇数 + 奇数 or 偶数 + 偶数 ''' cnt = 0 if int(s[-1]) & 1: for i in s[:-1]: if int(i) & 1: cnt += 1 else: for i in s[:-1]: if int(i) % 2 == 0: cnt += 1 print(cnt)