3 条题解

  • 1
    @ 2020-09-17 22:54:54

    #python3

    l=int(input())
    r=int(input())
    
    e=0    
    for i in range(l,r):
        a=i%10
        b=int(i//10)%10
        c=int(i//100)%10
        d=a+b+c
        if i%7==0 or d%7==0:
            e=e+1
        
    print(e)
    
    
  • 0
    @ 2020-09-21 16:27:50
    L=int(input())
    R=int(input())
    count=0
    List=[]
    for i in range(L,R+1):
        if i>0 and i<10:
            whole=i
        elif i>9 and i<100:
            a=str(i)[0]
            b=str(i)[1]
            whole=int(a)+int(b)
        elif i>99 and i<1000:
            a=str(i)[0]
            b=str(i)[1]
            c=str(i)[2]
            whole=int(a)+int(b)+int(c)
        if i%7==0:
            List.append(i)
        elif whole%7==0:
            List.append(i)
        else:
            continue
    length=len(List)
    print(length)
            
    
  • 0
    @ 2020-09-21 16:10:19
    L=int(input())
    R=int(input())
    a=0
    b=0
    for i in range(L,R+1):
        d=str(i)
        c=0
        for b in range(0,len(d)):
            c=c+int(d[b])
        if i%7==0 or c%7==0:
           a=a+1
    print(a)
    
    
  • 1

信息

ID
1025
难度
7
分类
(无)
标签
(无)
递交数
194
已通过
41
通过率
21%
上传者