コード例 #1
0
        static void Main(string[] args)
        {
            double length = double.Parse(Console.ReadLine());
            double width  = double.Parse(Console.ReadLine());
            double height = double.Parse(Console.ReadLine());

            Box box = new Box(length, width, height);

            box.PrintSurfaceArea();
            box.PrintLateralSurfaceArea();
            box.PrintVolume();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            double length = double.Parse(Console.ReadLine());
            double width  = double.Parse(Console.ReadLine());
            double height = double.Parse(Console.ReadLine());

            try
            {
                Box box = new Box(length, width, height);

                box.PrintSurfaceArea();
                box.PrintLateralSurfaceArea();
                box.PrintVolume();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }