예제 #1
0
 static void UseParams()
 {
     var calculator = new Calculator();
     Console.WriteLine(calculator.Add(1, 2));
     Console.WriteLine(calculator.Add(1, 2, 3));
     Console.WriteLine(calculator.Add(1, 2, 3, 4));
     Console.WriteLine(calculator.Add(new int[] { 1, 2, 3, 4, 5 }));
 }
예제 #2
0
        static void UseParams()
        {
            var calculator = new Calculator();

            Console.WriteLine(calculator.Add(5, 4, 3, 2, 1));
            Console.WriteLine(calculator.Add(2, 4, 6, 8, 10, 12, 14));
            Console.WriteLine(calculator.Add(new int[]
            {
                234, 4589, 27, 205, 374
            }));
        }
예제 #3
0
 static void UseCalc()
 {
     var calc = new Calculator();
     Console.WriteLine(calc.Add(10, 20, 30));
 }