void factoral(int N) { int arr[5120] = {}; int max = 0; arr[0] = 1; for(int i = 0;i < N;i++) { for(int j = 0;j < 5120;j++) arr[j] *= (i+1); for(int j = 0;j < 5120;j++) { if(0 < arr[j]/10) { arr[j+1] += arr[j]/10; arr[j] %= 10; max = j+1; } } } for(int i = max;i >=0;i--) { printf("%d",arr[i]); }
printf("\n"); }
标签:10,arr,数组,int,max,++,计算,阶乘,5120 From: https://www.cnblogs.com/ycddqr/p/17529795.html