5 条题解

  • 3

    #include <iostream>
    #include <cmath>
    using namespace std;

    int main()
    {
    int x;
    cin>>x;
    int n=sqrt(x);
    int x1=2;

    while(x1<=n)
    {
    if(x%x1==0)
    break;
    x1=x1+1;
    }
    if(x1<=n)
    cout<<"No"<<endl;
    else
    cout<<"Yes"<<endl;
    return 0;
    }

  • 1
    @ 2023-08-05 00:47:16

    #include <bits/stdc++.h>
    using namespace std;int main(){int n,i=2;cin>>n;for (;ii<=n;i++)if(!(n%i)){i=0;break;}if(i&&n!=1)cout<<"Yes";else cout<<"No";}//**请勿模仿**

  • 0
    #include <iostream>
    #include <cmath>
    using namespace std;
    
    int main()
    {
    int x;
    cin>>x;
    int n=sqrt(x);
    int x1=2;
    
    while(x1<=n)
    {
    if(x%x1==0)
    break;
    x1=x1+1;
    }
    if(x1<=n)
    cout<<"No"<<endl;
    else
    cout<<"Yes"<<endl;
    return 0;
    }
    
  • -2

    #include <iostream>
    using namespace std;
    int main()
    {
    int a,b=2;
    cin>>a;

    while(b<=a-1)
    {
    if(a%b==0)
    break;
    b++ ;
    }

    if(b<a)
    cout<<"No";
    else
    if(a!=1)
    cout<<"Yes";
    else
    cout<<"No";

    return 0;
    }

  • -5

    #include <iostream>
    using namespace std;

    int main()
    {
    int x;
    cin>>x;

    int x1=2;
    int b=0;
    while(x1<x)
    {
    if( x%x1==0 )
    ;
    x1=x1+1;
    b++;
    }
    if(b==2)
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;
    return 0;
    }

  • 1

信息

难度
7
分类
(无)
标签
递交数
4915
已通过
909
通过率
18%
被复制
8
上传者