C语言 判断一个是否素数

方法一: 暴力破解,缺点,速度慢 代码:web #include <stdio.h> #include <stdlib.h> #include <math.h> int judge(int n)//判断一个数是否是素数 { int count=0; int m=sqrt(n);//只须要检查到该数的平方根便可, for(int i=2;i<=m;i++) {
相关文章
相关标签/搜索