当前位置:网站首页>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);
}
(完)
边栏推荐
- MySQL常用语句总结
- JWT
- 2022年中盘点 | 产品打底,科技背书,广汽集团阔步向前
- Yang Hui Triangle (C language implementation)
- CTFshow,命令执行:web33
- 4种常见的鉴权方式及说明
- Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (4) Opening Report
- [Software Architecture Mode] The difference between MVVM mode and MVC mode
- Android Security and Protection Policy
- Custom Types - Enums, Unions
猜你喜欢
小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告
Promise学习(四)异步编程的终极解决方案async + await:用同步的方式去写异步代码
记一次 .NET 某智慧物流WCS系统CPU爆高分析
50.【Application of dynamic two-dimensional array】
ClickHouse入门介绍与其特性
退役划水
LeakCanary如何监听Service、Root View销毁时机?
gc的意义和触发条件
MacOS下postgresql(pgsql)数据库密码为什么不需要填写或可以乱填写
Promise学习(二)一篇文章带你快速了解Promise中的常用API
随机推荐
【钛晨报】国家统计局:7月制造业PMI为49%;玖富旗下理财产品涉嫌欺诈,涉及390亿元;国内航线机票燃油附加费8月5日0时起下调
CTFshow,命令执行:web33
我是如何保护 70000 ETH 并赢得 600 万漏洞赏金的
C#/VB.NET 将PPT或PPTX转换为图像
回归预测 | MATLAB实现TPA-LSTM(时间注意力注意力机制长短期记忆神经网络)多输入单输出
浏览器快捷键大全
在线GC日志分析工具——GCeasy
DBPack SQL Tracing 功能及数据加密功能详解
Pve delete virtual machine "for a collection"
一文说明白ECDSA spec256k1 spec256r1 EdDSA ed25519千丝万缕的关系
EasyRecovery热门免费数据检测修复软件
2022年7月31日--使用C#迈出第一步--使用 C# 创建具有约定、空格和注释的易读代码
Enterprise WeChat group: robot timing reminder function database configuration
微信公众号授权登录后报redirect_uri参数错误的问题
退役划水
JWT
IntellJ IDEA如何显示换行符(line endings)
2022年7月31日--使用C#迈出第一步--使用C#中的数组和foreach语句来存储和循环访问数据序列
Drawing arrows of WPF screenshot control (5) "Imitation WeChat"
回归预测 | MATLAB实现RNN循环神经网络多输入单输出数据预测