#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std ;
bool testprimer(int n) //test n is prime or not
{
bool rezult ;
for(int i=2;i<=sqrt(n);i++)
if(n%i==0) {
rezult = false ;
break ;
}
else rezult = true ;
return rezult ;
}
void superprime(int n , int number )
{
if(number==1)
cout<<n<<endl ;
else {
if(testprimer(10*n+1))
superprime(10*n+1,number-1);
if(testprimer(10*n+3))
superprime(10*n+3,number-1);
if(testprimer(10*n+7))
superprime(10*n+7,number-1);
if(testprimer(10*n+9)
superprime(10*n+9,number-1);
}
}
int main()
{
int number ;
cin>>number ;
superprime(2,number);
superprime(3,number);
superprime(5,number);
superprime(7,number);
system("pause");
return 0 ;
}
|