判断质数


bool
is_prime(int n) { for(int i=2;i*i<=n;i++) if(n%i===0) return 0; return 1; }
原文地址:https://www.cnblogs.com/thctianhaochen/p/5679984.html