Пример #1
0
        static void Main(string[] args)
        {
            int numberOfMsgs = int.Parse(Console.ReadLine());

            for (int i = 0; i < numberOfMsgs; i++)
            {
                Adverisment.PrintRandomAdvertisment();
            }
        }
Пример #2
0
        public static void PrintRandomAdvertisment()
        {
            Adverisment newAdver = new Adverisment();

            {
                int index = GiveRandomIndex(AllPhrases.Length);
                newAdver.Phrase = AllPhrases[index];
            }
            {
                int index = GiveRandomIndex(AllEvents.Length);
                newAdver.Event = AllEvents[index];
            }
            {
                int index = GiveRandomIndex(AllAuthors.Length);
                newAdver.Author = AllAuthors[index];
            }
            {
                int index = GiveRandomIndex(AllCities.Length);
                newAdver.City = AllCities[index];
            }

            Console.WriteLine($"{newAdver.Phrase} {newAdver.Event} {newAdver.Author} – {newAdver.City}.");
        }