Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140761 任艺宸 寻找绝对素数 C++ Wrong Answer 1 MS 268 KB 760 2025-12-20 12:20:21

Tests(1/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; bool s(int n) { for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } int f(int x) { int y=0; while(x!=0){ y=y*10+x%10; x/=10; } return y; } int main(){ int m,n,a=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(s(i)&&s(f(i))){ a++; if(a==1)cout<<i; else cout<<","<<i; } } if(a==0){ cout<<"No"<<endl; } return 0; }


Run Info:

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