Sieve of Eratosthenes: Difference between revisions
Content deleted Content added
Langurmonkey (talk | contribs) m →{{header|langur}}: changed where() to filter() |
m To create the PrimeXXX class, the new keyword has been added in front of the class's name in the testing Main method to eliminate a syntax error. |
||
Line 2,765: | Line 2,765: | ||
All of the above unbounded code can be tested by the following "main" method (replace the name "PrimesXXX" with the name of the class to be tested): |
All of the above unbounded code can be tested by the following "main" method (replace the name "PrimesXXX" with the name of the class to be tested): |
||
<syntaxhighlight lang="csharp"> static void Main(string[] args) { |
<syntaxhighlight lang="csharp"> static void Main(string[] args) { |
||
Console.WriteLine(PrimesXXX().ElementAt(1000000 - 1)); // zero based indexing... |
Console.WriteLine(new PrimesXXX().ElementAt(1000000 - 1)); // zero based indexing... |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||