int main()
{
int a = 0;
int b = 0;
int count = 0;
for (a = 100; a <= 200; a++)
{
for(b = 2; b < a; b++)
{
if ( a % b ==0)
{
break;
}
}
if ( a == b)
{
printf("%d",a);
count++;
}
}
printf("素数一共有 %d",count);
return 0;
}
C语言判断100-200之间的素数(质数)
最新推荐文章于 2024-08-14 18:20:25 发布