Run ID:71555

提交时间:2024-04-25 20:06:13

def judge_AB(n): #integer 整数 ones,zeros = 0,0 while n: #非0为True 0为False b = n%2 if b==1: ones +=1 else: zeros +=1 n = n//2 return ones>zeros #True:A类 False: B类 a =0 for num in range(1,1001): a += judge_AB(num) print(a,1000-a)