69印刷问题,老师,我哪儿错了?

k=0
g=0
n=int(input())
while n!=0:
a=str(input())
b=int(a)
if 100<=b<=999:
for g in range(0,3):
if a[g]=="6"or a[g]=="9":
k+=1
g+=1
else:
g+=1
else:
print("无效数")
n=n-1
else:
print(k)

1 条评论

  • 1