题解 | #挑7#人生苦短,我用python
挑7
http://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
while True:
try:
n = int(input())
seven_count = 0
for i in range(1, n + 1):
if i % 7 == 0:
seven_count += 1
continue
elif '7' in str(i):
seven_count += 1
print(seven_count)
except:
break
try:
n = int(input())
seven_count = 0
for i in range(1, n + 1):
if i % 7 == 0:
seven_count += 1
continue
elif '7' in str(i):
seven_count += 1
print(seven_count)
except:
break