当前位置:网站首页>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;
}边栏推荐
- Paper sharing: generating playful palettes from images
- Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
- retrofit
- 7-17 crawling worms (break exercise)
- [qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?
- adc128s022 ADC verilog设计实现
- Find the sum of the elements of each row of the matrix
- puzzle(016.3)千丝万缕
- Mysql多表查询 #子查询
- 亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
猜你喜欢

Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs

修改数据库中的记录为什么报这个错

【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?

Creation of data table of Doris' learning notes

分布式事务(Seata) 四大模式详解

Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion

adc128s022 ADC verilog设计实现

Zhonggan micro sprint technology innovation board: annual revenue of 240million, net loss of 17.82 million, proposed to raise 600million

愉悦资本新双币基金近40亿元完成首次关账

X86 assembly language - Notes from real mode to protected mode
随机推荐
适用于XP的DDK
【7.3】146. LRU caching mechanism
洛谷P5536 【XR-3】核心城市 题解
Zzuli:1040 sum of sequence 1
Tonybot humanoid robot checks the port and corresponds to port 0701
Thread.sleep和TimeUnit.SECONDS.sleep的区别
Raft agreement
Showmebug entered Tencent conference, opening the era of professional technical interview
retrofit
Paper sharing: generating playful palettes from images
ConstraintLayout 的使用
7-22 tortoise and rabbit race (result oriented)
MongoDB索引
洛谷P4047 [JSOI2010]部落划分 题解
Luogu p5536 [xr-3] core city solution
Understand the application scenario and implementation mechanism of differential segment
Plane vector addition
光猫超级账号密码、宽带账号密码 获取
Time conversion ()
puzzle(016.3)千丝万缕