search

Home  >  Q&A  >  body text

java初学者问题:输出前50个素数

怪我咯怪我咯2766 days ago807

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 10:40:27

    Replace while(n<500) with while(true). Because it breaks when it finds 100 prime numbers.
    In addition, the algorithm for determining prime numbers has room for optimization.

    reply
    0
  • Cancelreply