提交时间:2024-05-25 15:02:18
运行 ID: 148843
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum; cin>>n; if (n<2){ cout<<"No"; } else if (n==2){ cout<<"Yes"; } else if (n>2){ if (n%2==0){ cout<<"No"; } else if(n%2 != 0){ for (int i=1;i<=n;i++){ if (n%i==0){ sum++; } } if (sum==2){ cout<<"Yes"; }else{ cout<<"No"; } } } }