#include<math.h>
#include<stdio.h>
int main()
{
long int c, d, a, i, b;
printf("Please input c and d(c>2):");
scanf("%ld,%ld", &c, &d);
for (a = c ; a + 2 <= d; a++)
{
b = a + 2;
for (i = 2; i <= sqrt(b); i++)
if (a % i == 0 || (b) % (i + 2) == 0 || (b) % i == 0)
break;
if (i > sqrt(b))
printf("(%ld,%ld)", a, b);
}
return 0;
}
c语言孪生素数
最新推荐文章于 2023-11-01 20:07:32 发布