Beispiel #1
0
    public static void Main()
    {
        Matemática somador = new Matemática();

        somador.Soma(100, 200);            //int Soma(int, int)
        somador.Soma(100, 200, 300);       //int Soma(int, int, int)
        somador.Soma(100.1, 200.1);        //double Soma(double, double)
        somador.Soma(100.1, 200.1, 300.1); //double Soma(double, double, double)
    }
Beispiel #2
0
    public static void Main()
    {
        Matemática somador = new Matemática();

        somador.Soma(100, 200);            //int Soma(int, int)
        somador.Soma(100, 200, 300);       //int Soma(int, int, int)
        somador.Soma(100.1, 200.1);        //double Soma(double, double)
        somador.Soma(100.1, 200.1, 300.1); //double Soma(double, double, double)
        somador.Soma(1, 2, 3, 4);          //int Soma(params int[])
        somador.Soma(1, 2, 3, 4, 5);       //int Soma(params int[])
        somador.Soma(1d, 2d, 3d, 4d);      //double Soma(params double[])
        somador.Soma(1, 2, 3d, 4, 5);      //double Soma(params double[]) //;) trick
    }
Beispiel #3
0
    public static void Main()
    {
        Matemática somador = new Matemática();

        Console.WriteLine(somador.Soma(typeof(int), 100, 200));
        Console.WriteLine(somador.Soma(typeof(int), 100, 200, 300));
        Console.WriteLine(somador.Soma(typeof(double), 100.1, 200.1));
        Console.WriteLine(somador.Soma(typeof(double), 100.1, 200.1, 300.1));
        Console.WriteLine(somador.Soma(typeof(double), 1d, 2d, 3d, 4d));
        Console.WriteLine(somador.Soma(typeof(double), 1, 2, 3, 4, 5));
        Console.WriteLine(somador.Soma(typeof(double), 1, 2, 3d, 4, 5, 6));
    }