コード例 #1
0
        static void Main(string[] args)
        {
            var phoneNumbers = Console.ReadLine().Split().ToList();
            var websites     = Console.ReadLine().Split().ToList();

            Smartphone smartphone = new Smartphone();

            foreach (var phoneNumber in phoneNumbers)
            {
                try
                {
                    Console.WriteLine(smartphone.Call(phoneNumber));
                }
                catch (ArgumentException ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }

            foreach (var website in websites)
            {
                try
                {
                    Console.WriteLine(smartphone.Surf(website));
                }
                catch (ArgumentException ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }