Created
November 16, 2020 17:45
-
-
Save cosminpopescu14/c64989f91adbfd9a0fe501ea5f0e8760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace Craaash | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Random random = new(); | |
var x = Enumerable.Range(1, 500) | |
.Select(r => random.Next(500)) // do not put random in linq!!! | |
.Where(value => value > 0) | |
.Take(25); | |
//.ToHashSet(); | |
Console.WriteLine("Count: {0}", x.Count()); | |
foreach (var item in x) | |
{ | |
Console.WriteLine(item); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment