2020
10-07
10-07
JAVA及PYTHON质数计算代码对比解析
Java实现classPrimeNumber{publicstaticvoidmain(String[]args){longstart=System.currentTimeMillis();intcount=0;label:for(inti=1;i<=100000;i++){for(intj=2;j<=Math.sqrt(i);j++){if(i%j==0){continuelabel;//返回外层循环}}count++;//System.out.println(i);}longend=System.currentTimeMillis();System.out.println("count"+count);//9593System.out.println("...
继续阅读 >