大数算200!
程序代码:
using namespace System; using namespace System::Numerics; BigInteger Factorial(Int32 number); void main(void) { Int32 number(200); Console::WriteLine("{0}! = {1}", number, Factorial(number)); Console::ReadLine(); } // 计算指定数的阶乘 BigInteger Factorial(Int32 number) { BigInteger result(1); if (number >= 0) { for (Int32 i = 1; i <= number; ++i) { result *= i; } } return result; }
运行结果如下: