Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CRandom
- {
- public CRandom()
- {
- rand = new System.Random();
- }
- public void RandomSequence(int[] arr)
- {
- for (int i = 0; i < arr.Length; i++)
- {
- arr[i] = rand.Next(1, 50);
- for (int j = 0; j < i; j++)
- {
- while (arr[i] == arr[j])
- {
- arr[i] = rand.Next(1, 50);
- }
- }
- }
- }
- private System.Random rand;
- }
Advertisement
Add Comment
Please, Sign In to add comment