Пример #1
0
        static void Main()
        {
            Rectangle rectangle = new Rectangle();

            rectangle.GetValue();
            rectangle.Display();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Rectangle rect = new Rectangle(15, 20);

            rect.Display();
            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
        }
Пример #4
0
        static void Main(string[] args)
        {
            Rectangle r1 = new Rectangle(); //新增房间1,r1是房间1的钥匙
            Rectangle r2 = new Rectangle(); //新增房间2,r2是房间2的钥匙

            //Rectangle r3 = r1;//r3是房间1的钥匙

            r1.Acceptdetails(1.4, 2, "m");
            r2.Acceptdetails(1400, 2000, "mm");

            r1.Display();
            r2.Display();


            if (r1 == r2)
            {
                Console.WriteLine("===================");
            }
            else
            {
                Console.WriteLine("!!!!!!!!!!!!!!!!!!!");
            }

            Console.ReadLine();
        }
Пример #5
0
 static void Main(string[] args)
 {
     Rectangle r = new Rectangle();
     r.Acceptdetails();
     r.Display();
     Console.ReadLine();
 }
Пример #6
0
        static void main(String[] args)
        {
            int?num2 = 45;

            Rectangle r = new Rectangle();

            r.length = 5;
            r.width  = 2;
            r.Display();
            int max = r.FindMax(r.length, r.width);

            Console.ReadKey();

            r.Factorial(4);

            // Initialization of array
            int [] marks = new int[5] {
                1, 2, 3, 4, 5
            };
            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine("Element {0}: {1}", i, marks[i]);
            }

            foreach (int j in n)
            {
            }
        }
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Display();
            Console.WriteLine("Area: {0}", r.GetArea());
            Console.ReadLine();
        }
Пример #8
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.AcceptDetails(3, 4);
            r.Display();
            Console.ReadKey();
        }
Пример #9
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
        }
        void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
Пример #11
0
        static void Main(string[] args)
        {
            // 实例化一个类型对象
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
Пример #12
0
        static void Main(String[] args)
        {
            Rectangle r = new Rectangle();

            r.AcceptDetails();
            r.GetArea();
            r.Display();
            Console.ReadLine();
        }
Пример #13
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            Console.WriteLine("Hello World");
            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
        public static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.length = 3.5;
            r.width  = 4.5;
            r.Display();
            Console.ReadLine();
        }
Пример #15
0
        static void Main()
        {
            Rectangle r = new Rectangle();

            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.ReadLine();
        }
Пример #16
0
        static void Main(string[] args)
        {
            Rectangle myRectangle = new Rectangle();

            myRectangle.UserEntries();
            myRectangle.Display();


            Console.ReadLine();
        }
Пример #17
0
        static void Main_encapsulationpublic(string[] args)
        {
            Rectangle r = new Rectangle();

            //can access length, width and methods because all are declared public
            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.ReadLine();
        }
Пример #18
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle
            {
                length = 12.5,
                width  = 8.25
            };

            r.Display();
            ReadLine();
        }
Пример #19
0
 static void Main(string[] args)
 {
     Rectangle r = new Rectangle();
     //r.Acceptdetails();
     //r.length = 4.5;
     //r.width = 3.5;
     //r.Acceptdetails();
     r.length = 4.5;
     r.width = 3.5;
     r.Display();
     Console.ReadLine();
 }
Пример #20
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
            Console.WriteLine("Now comes the triangle. ");
            Triangle t = new Triangle();

            t.GetDetails(10, 30);
            t.Display();
            Console.ReadLine();
        }
Пример #21
0
        static void Main(string[] args)
        {
            WriteLine("Hit any key to view the next shape results\n");
            Rectangle r = new Rectangle();
            Triangle  t = new Triangle();
            Square    s = new Square();
            Octagon   o = new Octagon();

            t.Display();
            s.Display();
            r.Display();
            o.Display();
        }
Пример #22
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            //r.Acceptdetails();
            //r.length = 4.5;
            //r.width = 3.5;
            //r.Acceptdetails();
            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.ReadLine();
        }
Пример #23
0
        static void Main(string[] args)
        {
            Console.WriteLine("\n ----Rectangle---- \n");
            Rectangle r = new Rectangle();

            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.WriteLine("\n ----Triangle---- \n");
            Triangle t = new Triangle();

            t.GetData();
            t.Display();
            Console.WriteLine("\n ----Square---- \n");
            Square s = new Square();

            s.base_l = 10;
            s.height = s.base_l;
            s.Display();
            Console.ReadLine();
        }
Пример #24
0
        static void Main(string[] args)
        {
            Rectangle rectangle = new Rectangle(4.5, 4.6);

            rectangle.Display();
        }