| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 69962 | 余慕涵 | 素数对 | C++ | Accepted | 8 MS | 276 KB | 439 | 2024-04-12 20:15:25 |
#include <iostream> #include <cstdio> #include <cmath> using namespace std; bool op(int a){ for(int i=2;i<=sqrt(a);i++){ if(a%i==0){ return false;}} return true; } int main(){ int a,v=1; cin>>a; for(int i=2;i+2<=a;i++){ if(op(i)&&op(i+2)){ cout<<i<<" "<<i+2<<endl; v=0;} } if(v==1) cout<<"No"; return 0; }