Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class RandomNumbersinGivenRange
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int min = int.Parse(Console.ReadLine());
- int max = int.Parse(Console.ReadLine());
- Random rnd = new Random();
- for (int i = 1; i <= n; i++)
- {
- int random = rnd.Next(max) + min;
- if (random < min || random > max)
- {
- i--;
- continue;
- }
- Console.Write("{0} ", random);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement