字符串
n=int(input())
sum=0
for i in range(n):
if '2' not in str(i):
sum+=1
print(sum)
方法(2)
print(sum('2' not in str(i) for i in range(int(input()))))
字符串
n=int(input())
sum=0
for i in range(n):
if '2' not in str(i):
sum+=1
print(sum)
方法(2)
print(sum('2' not in str(i) for i in range(int(input()))))