#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
int n;
int s = 0;
for (int i = a; i <= b; i++)
{
int x = 0;
int m = i;
while (m > 0)
{
n = m % 10;
m = m / 10;
// cout << n;
s = 10 * s + n;
}
// cout << s;
if (s == i)
{
for (int j = 1; j <= i; j++)
{
if (i % j == 0)
{
x += 1;
}
}
if (x == 2)
{
cout << i << endl;
}
}
s = 0;
}
return 0;
}
c++素数回文
最新推荐文章于 2024-04-19 00:29:24 发布