题解 | #挑7#
挑7
https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
n = int(input()) sum = 0 C = '7' for i in range(1, n+1): if i % 7 == 0: sum += 1 elif C in str(i): sum += 1 print(sum)
挑7
https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
n = int(input()) sum = 0 C = '7' for i in range(1, n+1): if i % 7 == 0: sum += 1 elif C in str(i): sum += 1 print(sum)
相关推荐