예제 #1
0
        static void Main(string[] args)
        {
            var article          = Console.ReadLine().Split(", ");
            var newArticles      = new Articles(article);
            var numberOfArticles = int.Parse(Console.ReadLine());

            for (int i = 0; i < numberOfArticles; i++)
            {
                var command = Console.ReadLine().Split(": ", StringSplitOptions.RemoveEmptyEntries);
                switch (command[0])
                {
                case "Rename": newArticles.Rename(command[1]); break;

                case "Edit": newArticles.Edit(command[1]); break;

                case "ChangeAuthor": newArticles.ChangeAuthor(command[1]); break;
                }
            }
            Console.WriteLine(newArticles.ToString());
        }
예제 #2
0
        static void Main(string[] args)
        {
            string[] token = Console.ReadLine()
                             .Split(", ", StringSplitOptions.RemoveEmptyEntries)
                             .ToArray();


            Articles articles = new Articles(token[0], token[1], token[2]);

            int n = int.Parse(Console.ReadLine());


            for (int i = 0; i < n; i++)
            {
                string[] inputComand = Console.ReadLine().Split(": ").ToArray();

                string comand   = inputComand[0];
                string argument = inputComand[1];

                switch (comand)
                {
                case "Edit":
                    articles.Edit(argument);
                    break;

                case "ChangeAuthor":
                    articles.ChangeAutor(argument);
                    break;

                case "Rename":
                    articles.Rename(argument);
                    break;
                }
            }

            Console.WriteLine(articles.ToString());
        }