当前位置:网站首页>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);
}
(完)
边栏推荐
- Go-Excelize API source code reading (8) - GroupSheets(sheets []string), UngroupSheets()
- Basic configuration commands of cisco switches (what is the save command of Huawei switches)
- 【cartographer ros】10: Delay and error analysis
- 小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告
- 【cartographer ros】十: 延时和误差分析
- 如何从完美的智能合约中窃取 1 亿美元
- 从零开始Blazor Server(4)--登录系统
- ClickHouse多种安装方式
- 2022年7月31日--使用C#迈出第一步--使用C#中的数组和foreach语句来存储和循环访问数据序列
- Three chess (C language implementation)
猜你喜欢

Promise学习(四)异步编程的终极解决方案async + await:用同步的方式去写异步代码

周鸿祎称微软抄袭 360 安全模式后发文否认;英特尔CEO基辛格回应市值被AMD超越:股价下跌是咎由自取|极客头条

Why Metropolis–Hastings Works

C#/VB.NET 将PPT或PPTX转换为图像

PowerPC技术与市场杂谈

ClickHouse入门介绍与其特性

Batch大小不一定是2的n次幂!ML资深学者最新结论

Message queue interview latest finishing (2022)

C language game - minesweeper

Promise learning (2) An article takes you to quickly understand the common APIs in Promise
随机推荐
STM32 personal notes - program run and fly
CTFshow,命令执行:web32
What's up with VS "Cannot find or open PDB file"?How to solve
Push the local project to the remote repository
Kaitian aPaaS mobile phone number empty number detection [Kaitian aPaaS battle]
Google Earth Engine APP——15行代码搞定一个inspector高程监测APP
【cartographer ros】十: 延时和误差分析
还在纠结报表工具的选型么?来看看这个
世界第4疯狂的科学家,在103岁生日那天去世了
从零开始Blazor Server(4)--登录系统
How to Steal $100 Million from the Perfect Smart Contract
CTO strongly banning the use of the Calendar, that in what?
Custom Types - Enums, Unions
数仓分层简介(实时数仓架构)
什么是步进电机?40张图带你了解!
编码解码(btoa、encodeURIComponent、encodeURI、escape)
将本地项目推送到远程仓库
Qt 支持HEIC/HEIF格式图片
自定义类型——枚举、联合
RK3399 platform development series on introduction to (kernel) 1.52, printk function analysis - the function call will be closed