提交时间:2024-05-25 15:27:50
运行 ID: 148993
#include<iostream> #include<cmath> using namespace std; bool judge(int n){ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } int main(){ int n; cin>>n; if(n==0 || n==1){ cout<<"No"<<endl; return 0; } if(judge(n)==true){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; return 0; }