#include <stdio.h>
#include <math.h>
int is_prime(int n)
{
int j = 0;
for (j = 2; j <=sqrt(n); j++)
{
if (n % j == 0)
return 0;
}
return 1;
}
int main()
{
int i = 0;
for (i = 101; i <= 200; i+=2)
{
if (is_prime(i) == 1)
printf("%d ", i);
}
return 0;
}
标签:prime,判断,函数,int,素数,include
From: https://blog.51cto.com/u_16168351/6556562