python解法 ,似乎很简单,想的很复杂
(练习用)挑7
http://www.nowcoder.com/questionTerminal/ba241b85371c409ea01ac0aa1a8d957b
if name == 'main':
while True:
try:
n = input()
num =0
for i in range(6,n+1):
if '7' in str(i) or i%7 == 0:
num = num+1
print num
except:
break