예제 #1
0
        static void Main(string[] args)
        {
            MathOps m = new MathOps();

            Console.WriteLine($"Add = {m.Add(30,40)}");
            Console.WriteLine($"Mult = {m.Mult(30, 40)}");

            Console.WriteLine($"Add = {m.AddSquare(30, 40)}");
            Console.WriteLine($"Mult = {m.MultSquare(30, 40)}");

            string str = "James Bond";

            Console.WriteLine($"Length of {str} = {str.Length}");

            Console.WriteLine($"Reverse of {str} = {str.ExtReverse()}");

            Console.ReadLine();
        }
예제 #2
0
 public static int MultSquare(this MathOps m, int x, int y)
 {
     return((x * x) * (y * y));
 }
예제 #3
0
 public static int AddSquare(this MathOps m, int x, int y)
 {
     return((x * x) + (y * y));
 }