提交时间:2024-05-25 15:07:33
运行 ID: 148873
#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"; return 0; } for (int i=1;i<=n;i++){ if (n%i==0){ sum++; } } if (sum==2){ cout<<"Yes"; }else{ cout<<"No"; } } }