Problems D: generating a random number output c #

Title Description

Write an instance method Method01. The method uses a Random class generating n random three-digit number (e.g., 636) random positive integer, and the generated random number into an array and the array output int NUM = Convert.ToInt32 (Console.ReadLine ());
the using the System;
the using the System.Collections.Generic;
the using the System.Linq;
the using the System.Text;
the using System.Threading.Tasks;

namespace the ConsoleApplication1
{
    class Program
    {
        static void the Main (String [] args)
        {
            int NUM = Convert.ToInt32 (Console .readline ());
            Program.Method01 (NUM);
        }
/ *******************
         
      here. Code


*********** ********* /
    }
}
 

Entry

n

Export

An array of randomly generated

Sample input

3

Sample Output

636
555
545

prompt

        private static void Method01(int num)
        {
            for(int i = 0; i < num; i++)
            {
                Random a = new Random(i);
                int value = a.Next(100, 1000);
                Console.WriteLine(value);
            }
        }

  

Guess you like

Origin www.cnblogs.com/mjn1/p/12576467.html