Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Code challenge: Factorial
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Func<int,int> factorial = n => n > 0 ? Enumerable.Range(1,n) .Aggregate( (a,b) => a*b ) : 1; int[] numbers = { 0, 2, 3, 4, 5, 9 }; Array.ForEach(numbers, n => { Console.WriteLine("{0}! = {1}", n, factorial(n)); }); } } }
run
|
edit
|
history
|
help
0
Phone number regex validator
Find the missing number in an array2
CodeAdvent
sdfghnjmkuyhtgrfed
Hello
Download a UTF-8 text file, and display the contents.
eg
Math 10.93 added fracOp
Singleton Example
Triangulo de pascal