素数判定
//To determine a number is prime or not
int prime(int n)
{
if(n==1) return -1;
if(n==2) return 1;
else if(n%2==0) return 0;
else{
for (int i=3;i<=sqrt(n);i+=2)
if(n%i==0) return 0;
return 1;
}
}
//To determine a number is prime or not
int prime(int n)
{
if(n==1) return -1;
if(n==2) return 1;
else if(n%2==0) return 0;
else{
for (int i=3;i<=sqrt(n);i+=2)
if(n%i==0) return 0;
return 1;
}
}