#include<iostream>
#include<stdio.h>
#include<string.h>
#define MAX_SIZE 10000
void jisuan(int n);
using namespace std;
int main()
{
int n;
while (~scanf("%d", &n))
{
jisuan(n);
cout << endl;
}
return 0;
}
void jisuan(int n)
{
int arr[MAX_SIZE] = { 0 };
int Alen = 0;
arr[0] = 1; Alen = 1;
for (int k = 2; k <= n; k++)
{
int brr[10], Blen = 0, crr[MAX_SIZE] = { 0 }, Clen = 0;//b存放乘数,c存放当前阶乘的结果
int m = k;//从2开始相乘
int jinwei = 0;//记录进位
while (m != 0)//从2开始把每次计算的乘数存放到数组b中 倒着放的
{
brr[Blen++] = m % 10;
m /= 10;
}
for (int i = 0; i < Blen; i++)//当前阶乘要成的数
{
Clen = 0;
Clen += i;
for (int j = 0; j < Alen; j++)//当前已经计算好的阶乘数
{
int
2023东华oj题库进阶篇4 大阶乘计算
于 2023-02-13 09:09:45 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)