Пример #1
0
        static void Main(string[] args)
        {
            int           n            = int.Parse(Console.ReadLine());
            List <string> phrases      = new List <string>();
            Phrases       singlePhrase = new Phrases();

            List <string> events      = new List <string>();
            Events        singleEvent = new Events();

            List <string> authors      = new List <string>();
            Authors       singleAuthor = new Authors();

            List <string> cities     = new List <string>();
            Cities        singleCity = new Cities();



            for (int i = 0; i < n; i++)
            {
                int phraseNumber = GetPhraseIndex(phrases, singlePhrase);
                Console.Write($"{phrases[phraseNumber].Trim()} ");
                int eventNumber = GetEventIndex(events, singleEvent);
                Console.Write($"{events[eventNumber].Trim()} ");
                int authorNumber = GetAuthorIndex(authors, singleAuthor);
                Console.Write($"{authors[authorNumber].Trim()} - ");
                int cityNumber = GetCityIndex(cities, singleCity);
                Console.WriteLine(cities[cityNumber]);
            }
        }
Пример #2
0
        private static int GetPhraseIndex(List <string> phrases, Phrases singlePhrase)
        {
            phrases.Add(singlePhrase.phrase1);
            phrases.Add(singlePhrase.phrase2);
            phrases.Add(singlePhrase.phrase3);
            phrases.Add(singlePhrase.phrase4);
            phrases.Add(singlePhrase.phrase5);
            phrases.Add(singlePhrase.phrase6);
            int phraseNumber = rnd.Next(0, phrases.Count);

            return(phraseNumber);
        }