9 条题解

  • 6
    @ 2017-10-12 08:58:59

    a=int(input())
    b=int(input())
    a_ans=0
    b_ans=0
    for i in range(1,a):
    if a%i==0:
    a_ans+=i
    for j in range(1,b):
    if b%j==0:
    b_ans+=j
    if a_ans==b and a==b_ans:
    print('yes')
    else:
    print('no')

  • 4
    @ 2017-10-30 21:51:47
    a=int(input())
    b=int(input())
    a_ans=0
    b_ans=0
    for i in range(1,a):
            if a%i==0:
                a_ans+=i
    for j in range(1,b):
        if b%j==0:
            b_ans+=j
    if a_ans==b and a==b_ans:
        print('yes')
    else:
        print('no')
    
  • 1
    @ 2021-11-03 10:59:04

    a=int(input())
    b=int(input())
    yueshu1=0
    yueshu2=0
    for i in range(1,a):
    if a%i==0:
    yueshu1=yueshu1+i
    for i in range(1,b):
    if b%i==0:
    yueshu2=yueshu2+i
    if yueshu1==b and yueshu2==a:
    print('yes')
    else:
    print('no')

  • 1
    @ 2020-07-02 18:06:31

    a=int(input())
    b=int(input())

    n=1
    s=0
    while n<a:
    if a%n==0:
    s=s+n
    n=n+1

    m=1
    t=0
    while m<b:
    if b%m==0:
    t=t+m
    m=m+1

    if s==b and t==a:
    print("yes")

    else:
    print("no")

  • 1
    @ 2020-01-28 16:13:05

    a=x=int(input())
    b=y=int(input())
    for i in range(1,a):
    if a%i==0:
    y-=i
    for i in range(1,b):
    if b%i==0:
    x-=i
    if x==y==0:
    print("yes")
    else:
    print('no')

  • 1
    @ 2017-10-26 16:30:47

    还是用函数,思路很清晰hhh还有缩进我不管了,不管了。。。
    def fun(n):
    x=0
    for i in range(1,n):
    if n%i==0 :
    x=x+i
    return x

    a=int(input())
    b=int(input())
    if fun(a)==b and fun(b)==a :
    print("yes")
    else:
    print("no")

  • 0
    @ 2019-04-22 18:09:23
    def isprime(n):
        for i in range(2,n,1):
            if n%i==0:
                return False
        return True
    
    def total(c):
        k=0
        for i in range(1,c):
            if(c%i==0):
                k+=i
        return k
    
    a=[int(input()),int(input()),"no","yes"]
    print(a[int(total(a[0]) == a[1] and total(a[1]) == a[0])+2])
    
  • 0
    @ 2017-11-13 19:26:44

    def yue(a):
    l=0
    for i in range(1,a+1):
    if a%i==0:
    l=l+i
    else:
    l=l
    return l

    m=yue(int(input()))
    n=yue(int(input()))
    if m==n:
    print('yes')
    else:
    print('no')

  • 0
    @ 2017-10-30 16:45:36

    #include<stdio.h>

    int main () {

    int a,b;

    int i,j;

    int s1 = 0, s2 = 0;

    scanf("%d%d",&a, &b);

    for(i = 1; i < a; i ++){ //计算a的约数和 s1

    if(a%i == 0){

    s1 += i;

    }

    }

    if(s1 == b){

    for(i = 1; i < b; i ++){ //计算b的约数和 s2

    if(b%i == 0){

    s2 += i;

    }

    }

    if(s2 == a){

    printf("yes");

    } else {

    printf("no");

    }

    } else {

    printf("no");

    }

    return 0;

    }

  • 1

信息

难度
8
分类
(无)
标签
(无)
递交数
2162
已通过
713
通过率
33%
被复制
1
上传者