求n之内的函数对;
#include
using namespace std;
bool f(int n)
{
int i=2;
while(n%i!=0&&i<=n-1)
{
i++;
}
if(i>n-1)
{
return true;
}
else
{
return false;
}
}
int main()
{
int i,n;
bool empty=1;
cin>>n;
for(i=2;i<=n-2;i++)
{
if(f(i)&&f(i+2))
{
empty=0;
cout<<i<<" "<<i+2<<endl;
}
}
if(empty)
{
cout<<empty;
}
return 0;
}