当前位置:网站首页>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;
}
边栏推荐
- Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
- MySQL multi table query subquery
- Luogu p5536 [xr-3] core city solution
- Address book sorting
- Paper sharing: generating playful palettes from images
- 全文检索引擎Solr系列—–全文检索基本原理
- Find books ()
- Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
- 基因家族特征分析 - 染色体定位分析
- 编程语言:类型系统的本质
猜你喜欢
Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
Code writing and playing method of tonybot humanoid robot at fixed distance
GRPC的四种数据流以及案例
剑指 Offer 28. 对称的二叉树
tonybot 人形机器人 首次开机 0630
Detailed explanation of four modes of distributed transaction (Seata)
基因家族特征分析 - 染色体定位分析
Mysql多表查询 #子查询
Eight sorts
Tonybot humanoid robot infrared remote control play 0630
随机推荐
Solr series of full-text search engines - basic principles of full-text search
【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
Some concepts about agile
Time conversion ()
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
添加Zabbix计算类型项目Calculated items
Tonybot humanoid robot starts for the first time 0630
Sendmail can't send mail and it's too slow to send. Solve it
Although not necessarily the best, it must be the hardest!
Tiantu investment sprint Hong Kong stocks: asset management scale of 24.9 billion, invested in xiaohongshu and Naixue
SSH访问控制,多次失败登录即封掉IP,防止暴力破解
NPM install is stuck with various strange errors of node NPY
FPGA blocking assignment and non blocking assignment
Statistical capital consonants
puzzle(016.3)千丝万缕
提高效率 Or 增加成本,开发人员应如何理解结对编程?
Puzzle (016.3) is inextricably linked
Add ZABBIX calculation type itemcalculated items
How Facebook moves instagram from AWS to its own server
Luogu p5194 [usaco05dec]scales s solution