Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154187 杨登博 寻找绝对素数 C++ Accepted 754 MS 272 KB 796 2026-05-24 16:26:57

Tests(10/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){ if(x<2)return 0; 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++; } } if(s==0){ cout<<"No"; } return 0; }