当前位置:网站首页>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);
}
(完)
边栏推荐
- WTM:ASP.NET Core快速开发利器!
- Introduction and application of pointers
- 玻璃拟态(Glassmorphism)设计风格
- slice、splice、split傻傻分不清
- 7. SAP ABAP OData 服务如何支持 $orderby (排序)操作
- 如何解决 chrome 浏览器标签过多无法查看到标题的情况
- 这是我见过写得最烂的Controller层代码,没有之一!
- Promise learning (2) An article takes you to quickly understand the common APIs in Promise
- 小程序毕设作品之微信美食菜谱小程序毕业设计成品(2)小程序功能
- Introduction to data warehouse layering (real-time data warehouse architecture)
猜你喜欢

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

.NET深入解析LINQ框架(三:LINQ优雅的前奏)

50.【Application of dynamic two-dimensional array】

如何从完美的智能合约中窃取 1 亿美元

这是我见过写得最烂的Controller层代码,没有之一!

CTFshow,命令执行:web31

MacOS下postgresql(pgsql)数据库密码为什么不需要填写或可以乱填写

Endorsed in 2022 years inventory | product base, science and technology, guangzhou automobile group striding forward

Three chess (C language implementation)

小程序毕设作品之微信美食菜谱小程序毕业设计成品(1)开发概要
随机推荐
分类预测 | MATLAB实现1-DCNN一维卷积神经网络分类预测
上周热点回顾(7.25-7.31)
shell--第九章练习
Py之yellowbrick:yellowbrick的简介、安装、使用方法之详细攻略
shell--面试题
Promise learning (2) An article takes you to quickly understand the common APIs in Promise
.NET深入解析LINQ框架(三:LINQ优雅的前奏)
ClickHouse入门介绍与其特性
编码解码(btoa、encodeURIComponent、encodeURI、escape)
玻璃拟态(Glassmorphism)设计风格
小程序毕设作品之微信美食菜谱小程序毕业设计成品(3)后台功能
MySQL 必现之死锁
在线GC日志分析工具——GCeasy
【cartographer ros】10: Delay and error analysis
【无标题】
Promise学习(二)一篇文章带你快速了解Promise中的常用API
MTK6225-紧急电话
线上问题排查常用命令,总结太全了,建议收藏!!
Qt 支持HEIC/HEIF格式图片
jmeter