Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71 ZRH 素数对 C++ Wrong Answer 0 MS 264 KB 562 2022-07-19 02:52:28

Tests(1/10):


Code:

#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; bool s(int x){ for(int i=2;i<=sqrt(x);i++){ if(x%i==0){ return false; } } return true; } int main(){ int x,a=0; cin>>x; for(int i=2;i<=x;i++){ if(s(i)&&s(i+2)){ cout<<i<<" "<<i+2<<endl; a++; } } if(a=0){ cout<<"No"; } return 0; }


Run Info:

------Input------
5
------Answer-----
3 5
------Your output-----
3 5 5 7