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