当前位置:网站首页>C language implementation!20000 in 4 seconds
C language implementation!20000 in 4 seconds
2022-08-01 10:34: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);
}
(完)
边栏推荐
- 关于#SQL#的问题,如何解决?
- ClickHouse入门介绍与其特性
- Why Metropolis–Hastings Works
- xss漏洞学习
- 使用ESP32驱动QMA7981读取三轴加速度(带例程)
- What's up with VS "Cannot find or open PDB file"?How to solve
- 开天aPaaS之移动手机号码空号检测【开天aPaaS大作战】
- 石头科技打造硬核品牌力 持续出海拓展全球市场
- July 31, 2022 -- Take your first steps with C# -- Use arrays and foreach statements in C# to store and iterate through sequences of data
- PDMan-domestic free general database modeling tool (minimalist, beautiful)
猜你喜欢
7. SAP ABAP OData 服务如何支持 $orderby (排序)操作
如何从完美的智能合约中窃取 1 亿美元
Batch大小不一定是2的n次幂!ML资深学者最新结论
Small application project works WeChat gourmet recipes applet graduation design of finished product (1) the development profile
Endorsed in 2022 years inventory | product base, science and technology, guangzhou automobile group striding forward
.NET性能优化-使用SourceGenerator-Logger记录日志
xss-labs靶场挑战
复现assert和eval成功连接或失败连接蚁剑的原因
如何解决 chrome 浏览器标签过多无法查看到标题的情况
Yang Hui Triangle (C language implementation)
随机推荐
C语言实现!20000用4秒计算
深度学习 | MATLAB实现GRU门控循环单元gruLayer参数设定
使用ESP32驱动QMA7981读取三轴加速度(带例程)
阿里腾讯面试一二
shell脚本------条件测试 if语句和case分支语句
CTFshow,命令执行:web32
Browser shortcut keys
我是如何保护 70000 ETH 并赢得 600 万漏洞赏金的
xss-labs靶场挑战
C#/VB.NET 将PPT或PPTX转换为图像
自定义类型——枚举、联合
上周热点回顾(7.25-7.31)
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (3) Background Functions
Mysql索引相关的知识复盘一
STM32 Personal Notes - Watchdog
Three chess (C language implementation)
图解MySQL内连接、外连接、左连接、右连接、全连接......太多了
retired paddling
Promise学习(三)Promise的几个关键性问题 -- 状态改变、执行顺序与机制、多任务串联、异常穿透、中断promise链
回归预测 | MATLAB实现TPA-LSTM(时间注意力注意力机制长短期记忆神经网络)多输入单输出