示例#1
0
 static void Main(string[] args)
 {
     Console.WriteLine(
         Recursive.Func <int, int>(factorial =>
                                   x => x == 0 ? 1 : factorial(x - 1) * x
                                   )
             (10)
         );
     Console.WriteLine(
         Recursive.Func <int, int, int>(gcd =>
                                        (x, y) =>
                                        x == 0 ? y:
                                        y == 0 ? x:
                                        x > y  ? gcd(x % y, y):
                                        gcd(y % x, x)
                                        )
             (35, 21)
         );
 }