当前位置:网站首页>Factorization of large numbers ← C language
Factorization of large numbers ← C language
2022-06-29 12:22:00 【hnjzsyjyj】
【 Algorithm code 】
#include<stdio.h>
#define maxn 10005
int a[maxn]={1};
int len=maxn;
int c=0;
int main() {
int n;
scanf("%d",&n);
int i,j;
for(i=2; i<=n; i++)
for(c=0,j=0; j<len; j++) {
a[j]=a[j]*i+c;
c=a[j]/10;
a[j]%=10;
}
for(i=len-1; a[i]==0; i--); //Get rid of the leading zero
for(j=i; j>=0; j--)
printf("%d",a[j]);
return 0;
}
/*
20
2432902008176640000
*/
【 reference 】
https://blog.csdn.net/lisp1995/article/details/52403507
https://www.csdn.net/tags/NtDaMg4sODU4ODktYmxvZwO0O0OO0O0O.html
边栏推荐
- 易快报:我们用 Zadig 实现万次构建部署,聪明运维,释放开发生产力
- 535. TinyURL 的加密与解密 : 设计一个 URL 简化系统
- 年轻就要醒着拼,年轻就要勇于尝试
- 爱可可AI前沿推介(6.29)
- 高校如何基于云原生构建面向未来的智慧校园?全栈云原生架构VS传统IT架构
- [pbootcms模板]作文网站/文档下载网站源码
- Jerry's about TWS channel configuration [chapter]
- Helping the ultimate experience, best practice of volcano engine edge computing
- Engineering practice behind dall-e 2: ensure that the output of the model complies with the content policy
- 求大数的阶乘 ← C语言
猜你喜欢
随机推荐
Jerry's configuration of TWS cross pairing [chapter]
正大期货留4数据整合
ERP编制物料清单 金蝶
Gbase8s database into temp clause creates a temporary table to save query results.
正大期货主账户留4行情软件用的什么?
GBase8s数据库select有ORDER BY 子句
Quick look | the long-awaited 2022 Guangzhou assistant testing engineer's real problem analysis is finally released
ShanDong Multi-University Training #3
bison使用error死循环的记录
GBase8s数据库select有ORDER BY 子句6
Gbase8s database select has order by Clause 2
钛动科技:我们的 Zadig 落地之路
亲测!Centos7部署PHP + Swoole
每周推荐短视频:爱因斯坦是怎样思考问题的?
百度云盘不限速下载大文件(2021-11亲测有效)
智能垃圾桶(四)——树莓派pico实现超声波测距(HC-SR04)
牛顿不等式
ERP编制物料清单 华夏
When you are young, you should be awake to fight, and when you are young, you should have the courage to try
Cmake error






![Jerry's about TWS pairing mode configuration [chapter]](/img/c8/d78e817295169753244299545d9aba.png)

