Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
84 | ZRH | 寻找绝对素数 | C++ | Wrong Answer | 0 MS | 256 KB | 741 | 2022-07-19 03:34:49 |
#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; bool t1(int x){ if(x<=1){ return false; } for(int i=1;i<=sqrt(x);i++){ if(x%i==0){ return false; } } return true; } int t2(int n){ int a=0,c; while(n){ c=c*10+n%10; n/=10; } t1(c); } int main(){ int m,n,a=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(t1(i)&&t2(i)){ a++; if(a==1){ cout<<i; } else{ cout<<","<<i; } } } if(a==0){ cout<<"No"; } cout<<endl; return 0; }
------Input------
1 10
------Answer-----
2,3,5,7
------Your output-----
No