彻底平方数的判断

提示:主要是须要注意浮点数的偏差 code //包含math.h头文件 int m = floor(sqrt(n) + 0.5); //减少浮点数偏差的影响 if(m*m == n) { printf("m是彻底平方数"); }
相关文章
相关标签/搜索