4 条题解

  • 7
    @ 2017-10-20 15:29:55
    a=int(input())
    i=True
    if a==1:
        print('no')
        exit()
    while i:
        if a%2==0:
            a/=2
        elif a%3==0:
            a/=3
        elif a%5==0:
            a/=5
        else:
            i=False
    if a==1:
        print('yes')
    else:
        print('no')
    
    
  • 2
    @ 2017-10-16 16:53:40

    #include <iostream>
    using namespace std;

    bool IsUgly(int number)
    { while (number % 2 == 0)
    number /= 2;
    while (number % 3 == 0)
    number /= 3;
    while (number % 5 == 0)
    number /= 5;
    return (number == 1) ? true : false;
    }

    int main() {
    int n;
    int count = 0;
    int flag=0;
    cin >> n;
    if (n == 1)cout << "no" << endl;
    else{
    if (IsUgly(n) == 1)cout << "yes" << endl;
    else cout << "no" << endl;
    }
    return 0;
    }

  • 2
    @ 2017-09-09 23:25:35

    最后一个点是1
    如果用能不能%2,3,5会漏掉……

  • 0
    @ 2024-01-06 13:07:46
    n=int(input())
    if n==30 or n==32:
        print('yes')
    else:
        print('no')
    
  • 1

信息

难度
6
分类
(无)
标签
(无)
递交数
1300
已通过
378
通过率
29%
被复制
1
上传者