题解 | #挑7#
挑7
https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
n = int(input()) one2n = [i for i in range(1,n+1)] rls7 = n//7 for i in list(map(str,one2n)): if '7' in i and int(i)%7 != 0: rls7 += 1 print(rls7)
挑7
https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b
n = int(input()) one2n = [i for i in range(1,n+1)] rls7 = n//7 for i in list(map(str,one2n)): if '7' in i and int(i)%7 != 0: rls7 += 1 print(rls7)
相关推荐