当前位置:网站首页>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);
}
(完)
边栏推荐
- mysql在cmd的登录及数据库与表的基本操作
- What are the common API security flaws?
- 2022年7月31日--使用C#迈出第一步--使用 C# 创建具有约定、空格和注释的易读代码
- MySQL常用语句总结
- jmeter
- Guangyu Mingdao was selected into the list of pilot demonstration projects for the development of digital economy industry in Chongqing in 2022
- How to implement deep copy in js?
- slice、splice、split傻傻分不清
- gc的意义和触发条件
- notes....
猜你喜欢

小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告

ClickHouse多种安装方式

redis

基于CAP组件实现补偿事务与消息幂等性

The use of scrapy crawler framework

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

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

进制与转换、关键字

Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (3) Background Functions

The meaning and trigger conditions of gc
随机推荐
招聘随想2022
What are the common API security flaws?
昇思大模型体验平台初体验——以小模型LeNet为例
mysql在cmd的登录及数据库与表的基本操作
Small application project works WeChat gourmet recipes applet graduation design of finished product (1) the development profile
What is a stepper motor?40 pictures to show you!
自定义类型——枚举、联合
STM32 Personal Notes - Watchdog
【cartographer ros】十: 延时和误差分析
CTFshow,命令执行:web32
解决new Thread().Start导致高并发CPU 100%的问题
[Cloud Residency Co-Creation] Huawei Cloud Global Scheduling Technology and Practice of Distributed Technology
shell脚本------条件测试 if语句和case分支语句
notes....
PDMan-国产免费通用数据库建模工具(极简,漂亮)
PDMan-domestic free general database modeling tool (minimalist, beautiful)
记一次 .NET 某智慧物流WCS系统CPU爆高分析
广域铭岛入选2022年重庆市数字经济产业发展试点示范项目名单
C#/VB.NET 将PPT或PPTX转换为图像
experiment....