当前位置:网站首页>C语言实现!20000用4秒计算
C语言实现!20000用4秒计算
2022-08-01 10:24:00 【Kiopler】
#include <stdio.h>
#include <windows.h>
#define FACTORIAL 10000
int main()
{
unsigned char ucResult[50000] = {
0 };
int iMul = 2;
int iTmpResult = 0;
int iTmpMul = 0;
int iIdx = 0;
int iCarry = 0;
int iTmpInter = 0;
ucResult[0] = 1;
while (iMul <= FACTORIAL)
{
while (iIdx < sizeof(ucResult))
{
iTmpMul = ucResult[iIdx];
iTmpInter = iMul * iTmpMul + iCarry;
ucResult[iIdx] = iTmpInter % 10;
iCarry = iTmpInter / 10;
++iIdx;
}
iIdx = 0;
++iMul;
}
int i = sizeof(ucResult) - 1;
while (i >= 0)
{
printf("%d", ucResult[i]);
--i;
}
system("pause");
return(0);
}
(完)
边栏推荐
猜你喜欢
【软件架构模式】MVVM模式和MVC模式区别
Google Earth Engine APP——15行代码搞定一个inspector高程监测APP
CTFshow,命令执行:web33
.NET性能优化-使用SourceGenerator-Logger记录日志
7/31 训练日志
Small application project works WeChat gourmet recipes applet graduation design of finished product (1) the development profile
Mysql索引相关的知识复盘一
Meeting OA (Upcoming Meetings & All Meetings)
STM32 Personal Notes - Watchdog
VS“无法查找或打开PDB文件”是怎么回事?如何解决
随机推荐
LeakCanary如何监听Service、Root View销毁时机?
Meeting OA (Upcoming Meetings & All Meetings)
【cartographer ros】十: 延时和误差分析
July 31, 2022 -- Take your first steps with C# -- Use arrays and foreach statements in C# to store and iterate through sequences of data
jmeter
MFC实现交通图导航系统
深度学习 | MATLAB实现GRU门控循环单元gruLayer参数设定
【无标题】
MacOS下postgresql(pgsql)数据库密码为什么不需要填写或可以乱填写
Pve delete virtual machine "for a collection"
CTFshow,命令执行:web31
xss漏洞学习
Android 安全与防护策略
进制与转换、关键字
How to Steal $100 Million from the Perfect Smart Contract
小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告
shell--面试题
JWT
redis
7/31 训练日志