#include
#include
#include
#include
#include
int main()
{
std::cout << 2 << std::endl;
for (size_t ii = 3; ii < 1000;++ii)
{
std::stringstream sstemp;
sstemp << ii;
std::string str1, str2;
sstemp >> str1;
str2.assign(str1.rbegin(),str1.rend());
if (str1==str2)
{
for (size_t jj = 2; jj < ii;++jj)
{
if (ii%jj)
{
if (jj == ii - 1)
{
std::cout << ii << std::endl;
}
}
else
{
break;
}
}
}
}
system("pause");
return EXIT_SUCCESS;
}