当前位置:网站首页>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);
}
(完)
边栏推荐
猜你喜欢

AI篮球裁判火了,走步算得特别准,就问哈登慌不慌

Qt 支持HEIC/HEIF格式图片

已解决(pip安装库报错)Consider using the-- user option or check the permissions.

7. SAP ABAP OData 服务如何支持 $orderby (排序)操作

mysql在cmd的登录及数据库与表的基本操作

【钛晨报】国家统计局:7月制造业PMI为49%;玖富旗下理财产品涉嫌欺诈,涉及390亿元;国内航线机票燃油附加费8月5日0时起下调

Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (4) Opening Report

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

What's up with VS "Cannot find or open PDB file"?How to solve

C language game - minesweeper
随机推荐
自定义类型——枚举、联合
ModelArts-based object detection YOLOv3 practice [play with HUAWEI CLOUD]
图解MySQL内连接、外连接、左连接、右连接、全连接......太多了
小程序毕设作品之微信美食菜谱小程序毕业设计成品(2)小程序功能
ClickHouse多种安装方式
开天aPaaS之移动手机号码空号检测【开天aPaaS大作战】
对于小应用来讲,使用哪款数据库比较好?
Enterprise WeChat group: robot timing reminder function database configuration
CTFshow,命令执行:web33
C语言小游戏——扫雷
ClickHouse入门介绍与其特性
.NET性能优化-使用SourceGenerator-Logger记录日志
Basic configuration commands of cisco switches (what is the save command of Huawei switches)
What is a stepper motor?40 pictures to show you!
7/31 训练日志
Endorsed in 2022 years inventory | product base, science and technology, guangzhou automobile group striding forward
SAP ABAP OData 服务如何支持 $orderby (排序)操作试读版
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (4) Opening Report
InputStream转成String
CTFshow,命令执行:web32