static void Main(string[] args) { string[] token = Console.ReadLine().Split(", "); Arcticle arcticle = new Arcticle(token[0], token[1], token[2]); int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { string[] cmdArg = Console.ReadLine().Split(": "); string command = cmdArg[0]; string argument = cmdArg[1]; switch (command) { case "Edit": arcticle.Edit(argument); break; case "ChangeAuthor": arcticle.ChangeAuthor(argument); break; case "Rename": arcticle.Reneme(argument); break; } } Console.WriteLine(arcticle.ToString()); }
static void Main(string[] args) { var input = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .ToArray(); Arcticle article = new Arcticle(input[0], input[1], input[2]); int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { var command = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .ToArray(); switch (command[0]) { case "Edit": article.Edit(command[1]); break; case "ChangeAuthor": article.ChangeAuthor(command[1]); break; case "Rename": article.Rename(command[1]); break; default: break; } } Console.WriteLine(article.ToString()); }