本文转载自:http://blog.youkuaiyun.com/huang_miao_xin/article/details/51331710 补充改进:除2之外, 只有奇数才可能是素数,所以for循环中每次可以直接加2