#include<stdio.h>
/*判断100-200之间的素数*/
int main ()
{
int num,point,rem,temp;
for(num=100;num<=200;num++)
{
point=1;
for(temp=2;temp<num;temp++)
{
rem=num%temp;
if(rem==0)
{
point=0;
break;
}
}
if(point==1)
printf("%d ",num);
}
return 0;
}
时间: 2024-11-05 19:46:02