Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
69 ZRH 素数对 C++ Wrong Answer 0 MS 248 KB 513 2022-07-19 02:51:04

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; cin>>x; for(int i=2;i<=x;i++){ if(s(i)&&s(i+2)){ cout<<i<<" "<<i+2<<endl; } } return 0; }


Run Info:

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