Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154185 杨登博 寻找绝对素数 C++ Wrong Answer 16 MS 276 KB 735 2026-05-24 16:25:09

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; int z(int x){ for(int i=2;i<=x/2;i++){ if(x%i==0){ return 0; } } return 1; } int fz(int y){ int f=0; while(y!=0){ f=f*10+y%10; y/=10; } return z(f); } int main(){ int m,n,s=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(z(i)&&fz(i)){ if(s) cout<<","<<i; else cout<<i; s++; } } return 0; }


Run Info:

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