• P1018-P1020


    #include<iostream>
    #include<cmath>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        int sum=0;
        for(int i=2;i<=sqrt(n);i++)
        {
            if(n%i==0)
            {
                sum++;
            }
        }
        if(sum==1)
        {
            cout<<"It's a MaoLaoDa number."<<endl;//注意大小写
        }
        else
        {
            cout<<"It's not a MaoLaoDa number."<<endl;
        }
    }
     
     
     
     
    #include<iostream>
    #include <algorithm>
    #include <cmath>
    using namespace std;
    int n;
    int main()
    {
        cin>>n;
        for (int i = 1;i <= 50000;i++)
        {
            int a = sqrt(i),tot = 0;
            if (a * a == i)
            {
                tot = 1;
                a--;
            }
            for (int j = 1;j <= a;j++)
            {
                if (i % j == 0) tot += 2;//有一对时加2
            }
            if (tot == n)
            {
                cout<<i<<endl;
                return 0;
            }
         }
       }
     
     
     
    #include<iostream>
    using namespace std;
    int main()
    {
        int k;
        cin>>k;
        int judge=0;
        for(int i=10000;i<=30000;i++)
        {
            int a,b,c;
            a=i%1000;    //每三位取模
            b=i/10%1000;
            c=i/100;
            if(a%k==0&&b%k==0&&c%k==0)
            {
                judge++;
                cout<<i<<endl;
            }
        }
        if(judge==0)
        {
            cout<<"No"<<endl;//N
        }
        return 0;
    }
  • 相关阅读:
    H3C 配置vlan及vlan间路由
    H3C 端口安全技术
    H3C 备份系统应用程序与文件
    H3C 类似于Linux编辑命令
    H3C telnet
    H3C基本命令
    Python里的目录
    Python 模块
    Python 函数
    JS 100内与7相关的数
  • 原文地址:https://www.cnblogs.com/Chri-K/p/13634611.html
Copyright © 2020-2023  润新知