using System.Collections.Generic;
using System.Linq;
using System;
publicstaticclass Utilities
{
publicstatic ulong Factorial(uint value)
{
// ulong.MaxValue is smaller than the result of 21!
if (value > 20)
{
thrownew ArgumentException("value");
}
if (value == 0)
{
return 1;
}
else
{
return value * Factorial(value - 1);
}
}
}