| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 83998 | 胡盛哲 | 素数对 | C++ | Wrong Answer | 1 MS | 268 KB | 409 | 2024-07-15 10:55:16 |
#include<bits/stdc++.h> using namespace std; bool sushu (int x){ for(int t=2;t<x;t++){ if(x%t==0){ return false; } } return true; } int main(){ int n,num=0,f=0; cin>>n; for(int i=2;i+2<=n;i++){ if(sushu(i)){ if(sushu(i+2)){ cout<<i<<" "<<i+2<<endl; num++; } } } cout << num; return 0; }
------Input------
17
------Answer-----
3 5 5 7 11 13
------Your output-----
3 5 5 7 11 13 3