Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
24169 hetiantian 【PAT】性感素数 C++ 编译错误 0 MS 0 KB 518 2023-07-21 15:50:07

Tests(0/0):


#include <bits/stdc++.h> using namespace std; bool check(int x){ for(int i=2;i*i<=x;i++) if(x%i==0){ return false; } return true; } int main(){ int n,ans; cin>>n; int m=n-6,s=n+6; if(check(n)){ if(m==5){ cout<<"Yes"<<endl; cout<<"11"; } else if(m==2||m==3){ cout<<"No"; } if(check(m)||check(s)){ else{ cout<<"Yes"<<endl; ans=min(m,s); cout<<ans; return 0; } } else{ cout<<"No"; return 0; } } else{ cout<<"No"; } }


测评信息: