题解 | #挑7#
挑7
https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
import sys n = int(sys.stdin.readline().strip()) count = 0 for num in range(1, n+1): num2str = str(num) if num%7 == 0 or '7' in num2str: count += 1 print(count)
挑7
https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
import sys n = int(sys.stdin.readline().strip()) count = 0 for num in range(1, n+1): num2str = str(num) if num%7 == 0 or '7' in num2str: count += 1 print(count)
相关推荐