关于回文素数的问题
我自己写的代码如下,为什么出来的结果是1?

#include <iostream>
#include <fstream>
using namespace std;
void huiwen10();
void sushu();
int main()
{
sushu();
huiwen10();
}
void sushu()
{
int a=1;
ofstream out("prime.dat");
for(int n=1;n<=10000;n++)
{
for(int i=2;i<n;i++)
{
if(n%i==0)
{
a=0;
break;
}
}
if(a)
out<<n<<endl;
a=1;
}
}
void huiwen10()
{
long a,temp,b=0;
ifstream in("prime.dat");
ofstream out("p10.dat");
for(a;in>>a;)
{
temp=a;
while(temp>0)
{
b=b*10+temp%10;
temp=temp/10;
}
if (b==a)
{
cout<<b<<endl;
out<<b<<endl;
}
}
}