Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Advertisement_Message
- {
- class Program
- {
- static void Main()
- {
- int numMessages = int.Parse(Console.ReadLine());
- List<string> phrases = new List<string>()
- {
- "Excellent product.", "Such a great product.", "I always use that product.",
- "Best product of its category.", "Exceptional product.", "I can’t live without this product."
- };
- List<string> events = new List<string>()
- {
- "Now I feel good.", "I have succeeded with this product.", "Makes miracles. I am happy of the results!",
- "I cannot believe but now I feel awesome.", "Try it yourself, I am very satisfied.", "I feel great!"
- };
- List<string> authors = new List<string>()
- {
- "Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva"
- };
- List<string> cities = new List<string>()
- {
- "Burgas", "Sofia", "Plovdiv", "Varna", "Ruse"
- };
- var message = new Fake_Message(phrases, events, authors, cities);
- Random rndMssg = new Random();
- for (int i = 0; i < numMessages; i++)
- {
- int phrase = rndMssg.Next(0, message.Phrases.Count);
- int thing = rndMssg.Next(0, message.Events.Count);
- int author = rndMssg.Next(0, message.Authors.Count);
- int city = rndMssg.Next(0, message.Cities.Count);
- Console.WriteLine($"{message.Phrases[phrase]} {message.Events[thing]} {message.Authors[author]} - {message.Cities[city]}");
- }
- }
- }
- class Fake_Message
- {
- public Fake_Message(List<string> phrases, List<string> events, List<string> authors, List<string> cities)
- {
- Phrases = phrases;
- Events = events;
- Authors = authors;
- Cities = cities;
- }
- public List<string> Phrases { get; set; }
- public List<string> Events { get; set; }
- public List<string> Authors { get; set; }
- public List<string> Cities { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment