#include<stdio.h>
#include<math.h>
int main()
{
int i=0;
int j=0;
int count=0;
for(i=101;i<=sqrt(i);i+=2){
for(j=2;j<=i-1;j++){
if(i%j==0){
break;
}
}
if(j>sqrt(i)){
printf("%d ",i);
count++;
}
}
printf("\ncount= %d ",count);
system("pause");
return 0;
}
试除法求素数
最新推荐文章于 2024-06-11 13:58:52 发布