using System using System Collections Generic int required_count 123 R

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using System;
using System.Collections.Generic;
int required_count = 123;
Random random = new Random ();
HashSet <int> generated = new HashSet <int> ();
while (generated.Count < required_count)
{
int next = random.Next (1, 38);
generated.Add (next)
}