Chẵn lẻ
lqdojtocdovodoi
plain_text
a year ago
349 B
8
Indexable
def check(s): n = str(s) for i in range(len(n)): if (i % 2 == 0 and int(n[i]) % 2 == 0) or (i % 2 != 0 and int(n[i]) % 2 != 0): return 0 return 1 n = int(input()) ds = [] for i in range(n): ds.append(int(input())) for i in ds: if check(i)==1: print("YES") else: print("NO")
Editor is loading...
Leave a Comment