标签:
receive int n
loop i from 2 to n-1
if n mod i equals 0 then exit(true)
exit(false)
然而一个数是合数必有一个小于等于sqrt(n)的素因子receive int n
loop i from 2 cond i*i<=n
if n mod i equals 0 then exit(true)
exit(false)
标签:
原文地址:http://www.cnblogs.com/tmzbot/p/HighSchoolMath_MUST3.html