Exemple #1
0
        static void UseCalculator()
        {
            var caculate = new calculator();

            Console.WriteLine(caculate.Add(2, 4, 6, 8));
            Console.WriteLine(caculate.Add(new int[] { 10, 4, 6, 8 }));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            calculator cal = new calculator();
            int        z   = cal.add(10, 20);
            int        p   = cal.sub(20, 10);
            int        q   = cal.mul(20, 10);
            int        r   = cal.div(20, 10);
            int        s   = cal.mod(20, 10);

            Console.WriteLine("add:{0}", z);
            Console.WriteLine("sub:{0}", p);
            Console.WriteLine("mul:{0}", q);
            Console.WriteLine("div:{0}", r);
            Console.WriteLine("mod:{0}", s);
            Console.ReadLine();
        }