prime numbers c#

前端 未结 8 1701

I\'m new to C#. And I would like to program something like, displaying the prime numbers in a listbox if user will input any integer in the textbox. (that means, if they wri

8条回答
  •  抹茶落季
    2020-12-11 19:06

    Here's a great "naive" prime number algorithm, that would be perfect for your needs: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

提交回复
热议问题