79

质数的判断-liu1340308350的博客-51CTO博客

 6 years ago
source link: http://blog.51cto.com/13572850/2069540
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
定义:质数(primenumber)又称素数。一个大于1的自然数,除了1和它自身外,不能被其他自然数整除的数叫做质数;否则称为合数。(1不是质数)packagetest;publicclassHelloWorld{publicstaticvoidmain(String[]args){intN=10;//判断是否是质数的数字booleanisPrime=true;//true:是质数false:不是

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK