Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Pick-random-element/C-sharp/pick-random-element.cs
Normal file
11
Task/Pick-random-element/C-sharp/pick-random-element.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
class RandomElementPicker {
|
||||
static void Main() {
|
||||
var list = new List<int>(new[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
|
||||
var rng = new Random();
|
||||
var randomElement = list[rng.Next(list.Count)];
|
||||
Console.WriteLine("I picked element {0}", randomElement);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue