题目:
AC代码
#include<bits/stdc++.h>
using namespace std;
bool isShushu(int a)
{
bool flag = true;
if (a > 1)
{
for (int i = 2; i <= sqrt(a); i++)
{
if (a % i == 0)
{
flag = false;
break;
}
}
}
else
{
flag = false;
}
return flag;
}
int fanxu(int x)
{
int y = 0;
while (x)
{
y = x % 10 + y * 10;
x /= 10;
}
return y;
}
int main(){
int m, n, conut = 0;
cin >> m >> n;
for (int i = m; i <= n; i++){
if (isShushu(i) && isShushu(fanxu(i))){
if (conut > 0){
cout << ',';
}
conut++;
cout << i;
}
}
if (conut == 0){
cout << "No";
}
return 0;
}
合格证
标签:std,AC,cout,int,少儿,乔斯,bool,fake,isShushu From: https://blog.csdn.net/2301_76217337/article/details/140360586