C++:100阶乘数组输出

#include <iostream>

using namespace std;

int main()
{
  int i =1;
  int a[2048]={0};
  while(i !=101)
  {
    for(i =2,a[0]=1;i<=100;i++)
    {
      for(int j =0,t =0;j<=i*4;j++)
      {
        a[j] =a[j]*i +t;
        t = a[j]/10;
        a[j] = a[j]%10;
      }
    }
  }
  for(i = 2047;a[i] == 0;i--);
  for(;i>=0;i--)
    cout << a[i];
}

原文地址:https://www.cnblogs.com/gzk1171848896/p/9525591.html