当前位置:网站首页>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);
}
(完)
边栏推荐
- Guangyu Mingdao was selected into the list of pilot demonstration projects for the development of digital economy industry in Chongqing in 2022
- 分类预测 | MATLAB实现1-DCNN一维卷积神经网络分类预测
- AI篮球裁判火了,走步算得特别准,就问哈登慌不慌
- 2022年中盘点 | 产品打底,科技背书,广汽集团阔步向前
- 使用ESP32驱动QMA7981读取三轴加速度(带例程)
- shell脚本------条件测试 if语句和case分支语句
- 对于小应用来讲,使用哪款数据库比较好?
- STM32 Personal Notes - Watchdog
- rpm and yum
- EasyRecovery热门免费数据检测修复软件
猜你喜欢

Opencv creates a window - cv.namedWindow()

招聘随想2022

一文说明白ECDSA spec256k1 spec256r1 EdDSA ed25519千丝万缕的关系

世界第4疯狂的科学家,在103岁生日那天去世了

Qt supports HEIC/HEIF format images

DBPack SQL Tracing 功能及数据加密功能详解

C language game - minesweeper

Golang内存分析工具gctrace和pprof实战

还在纠结报表工具的选型么?来看看这个

Google Earth Engine APP——15行代码搞定一个inspector高程监测APP
随机推荐
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (3) Background Functions
Introduction and application of pointers
How to implement deep copy in js?
DBPack SQL Tracing 功能及数据加密功能详解
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (4) Opening Report
【cartographer ros】10: Delay and error analysis
Basic configuration commands of cisco switches (what is the save command of Huawei switches)
Visualization - Superset installation and deployment
50.【动态二维数组的运用】
小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告
URL.createObjectURL、URL.revokeObjectURL、Uint8Array、Blob使用详解
Pve delete virtual machine "for a collection"
已解决(pip安装库报错)Consider using the-- user option or check the permissions.
如何解决 chrome 浏览器标签过多无法查看到标题的情况
jmeter
【云驻共创】分布式技术之华为云全域调度技术与实践
Introduction to data warehouse layering (real-time data warehouse architecture)
Batch大小不一定是2的n次幂!ML资深学者最新结论
进制与转换、关键字
使用ESP32驱动QMA7981读取三轴加速度(带例程)