当前位置:网站首页>Zzuli: cumulative sum of 1050 factorials
Zzuli: cumulative sum of 1050 factorials
2022-07-03 14:34:00 【Snake_____】
Title Description
seek 1! + 2! + ……n!
Input
Enter an integer n, You can assume that n No more than 10.
Output
Output an integer , That is, the result of factorial accumulation , Take a line alone .
The sample input Copy
4
Sample output Copy
33
#include <stdio.h>
int main()
{
int n,i,sum=0,mul=1;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
mul=mul*i;
sum=sum+mul;
}
printf("%d",sum);
return 0;
}
边栏推荐
- Although not necessarily the best, it must be the hardest!
- puzzle(016.3)千丝万缕
- 7-2 and then what time (15 minutes)
- Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
- Etcd cluster permission management and account password usage
- 愉悦资本新双币基金近40亿元完成首次关账
- Code writing and playing method of tonybot humanoid robot at fixed distance
- Common shortcut keys in PCB
- 2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
- Detailed explanation of four modes of distributed transaction (Seata)
猜你喜欢
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
Tonybot Humanoïde Robot Infrared Remote play 0630
US stock listing of polar: how can the delivery of 55000 units support the valuation of more than 20billion US dollars
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
Code writing and playing method of tonybot humanoid robot at fixed distance
retrofit
Luogu p4047 [jsoi2010] tribal division solution
Four data flows and cases of grpc
洛谷P4047 [JSOI2010]部落划分 题解
随机推荐
Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
Too many files with unapproved license
String sort
Eight sorts
使用并行可微模拟加速策略学习
C language,%d% Difference between 2D%2d%02d
剑指 Offer 28. 对称的二叉树
Doris学习笔记之数据表的创建
Find the sum of the elements of each row of the matrix
String substitution
Thread.sleep和TimeUnit.SECONDS.sleep的区别
7-15 calculation of PI
Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
分布式事务(Seata) 四大模式详解
SSH访问控制,多次失败登录即封掉IP,防止暴力破解
ZABBIX saves the page blank after adding calculated items
MongoDB索引
Showmebug entered Tencent conference, opening the era of professional technical interview
Timecho of Tianmou technology completed an angel round financing of nearly 100 million yuan to create a native timing database of the industrial Internet of things
7-3 rental (20 points)