当前位置:网站首页>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);
}
(完)
边栏推荐
- 解决new Thread().Start导致高并发CPU 100%的问题
- WPF 截图控件之绘制箭头(五)「仿微信」
- shell--面试题
- Basic configuration commands of cisco switches (what is the save command of Huawei switches)
- DBPack SQL Tracing 功能及数据加密功能详解
- redis
- SQL Server database schema and objects related knowledge notes
- C#/VB.NET 将PPT或PPTX转换为图像
- Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (3) Background Functions
- The use of scrapy crawler framework
猜你喜欢
随机推荐
关于#SQL#的问题,如何解决?
线上问题排查常用命令,总结太全了,建议收藏!!
C#/VB.NET 将PPT或PPTX转换为图像
自定义类型——枚举、联合
Introduction and application of pointers
ClickHouse入门介绍与其特性
CTFshow,命令执行:web34、35、36
Drawing arrows of WPF screenshot control (5) "Imitation WeChat"
[Cloud Residency Co-Creation] Huawei Cloud Global Scheduling Technology and Practice of Distributed Technology
阿里腾讯面试一二
shell--第九章练习
Basic configuration commands of cisco switches (what is the save command of Huawei switches)
小程序毕设作品之微信美食菜谱小程序毕业设计成品(2)小程序功能
Introduction to STM32 development Introduce IIC bus, read and write AT24C02 (EEPROM) (using analog timing)
xss-labs靶场挑战
InputStream转成String
RK3399平台开发系列讲解(内核入门篇)1.52、printk函数分析 - 其函数调用时候会关闭中断
EasyRecovery热门免费数据检测修复软件
notes....
ModelArts-based object detection YOLOv3 practice [play with HUAWEI CLOUD]