Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
130079 毛靖平 寻找绝对素数 C++ Wrong Answer 3 MS 268 KB 613 2025-09-07 15:38:17

Tests(1/10):


Code:

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int sum(int x){ int s=1; for(int i=2;i<=sqrt(x);i++){ if(x%i==0){ return 0; } } return 1; } int v(int x){ int m=x; int n=0; while(m>0){ n=n*10+m%10; m=m/10; } return n; } int main(){ int n,c=0,m,k; cin>>m>>n; for(int j=m;j<=n;j++){ k=v(j); if(sum(j)&&sum(k)){ if(c==0){ cout<<j; c++; } else{ cout<<","<<j; } } } if(c==0){ cout<<"No"; } return 0; }


Run Info:

------Input------
1 10
------Answer-----
2,3,5,7
------Your output-----
1,2,3,5,7