当前位置:网站首页>Class summation, shortest row
Class summation, shortest row
2022-07-04 03:33:00 【Yueyechong】
import math
d=0
n=int(input())
for i in range(n+1):
d+=math.factorial(i)
print(d)math.factorial() Directly calculate the hierarchical value , If you really can't remember or understand, use this first
import math
d=1
n=int(input())
for i in range(1,n+1):
j=1
for b in range(1,i+1):
j*=b# Multiply internal loops
d+=j
print(d)There is no function call
边栏推荐
- Typical applications of minimum spanning tree
- 7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages
- static hostname; transient hostname; pretty hostname
- Lichuang EDA learning notes 14: PCB board canvas settings
- Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
- Consul of distributed service registration discovery and unified configuration management
- In my spare time, I like to write some technical blogs and read some useless books. If you want to read more of my original articles, you can follow my personal wechat official account up technology c
- Solve the problems encountered by the laravel framework using mongodb
- Explain AI accelerator in detail: why is this the golden age of AI accelerator?
- Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
猜你喜欢

Setting methods, usage methods and common usage scenarios of environment variables in postman

Practical multifunctional toolbox wechat applet source code / support traffic master

Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress

Typical applications of minimum spanning tree

Résumé: entropie, énergie libre, symétrie et dynamique dans le cerveau

Have you entered the workplace since the first 00???

Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami
![[Valentine's Day confession code] - Valentine's Day is approaching, and more than 10 romantic love effects are given to the one you love](/img/ab/066923f1aa1e8dd8dcc572cb60a25d.jpg)
[Valentine's Day confession code] - Valentine's Day is approaching, and more than 10 romantic love effects are given to the one you love

MySQL data query optimization -- data structure of index

How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
随机推荐
MySQL query
Apple submitted the new MAC model to the regulatory database before the spring conference
Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi
Redis transaction
Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
96% of the collected traffic is prevented by bubble mart of cloud hosting
Unity controls the selection of the previous and next characters
2022 attached lifting scaffold worker (special type of construction work) free test questions and attached lifting scaffold worker (special type of construction work) examination papers 2022 attached
Slurm view node configuration information
The difference between MCU serial communication and parallel communication and the understanding of UART
Consul of distributed service registration discovery and unified configuration management
How to use websocket to realize simple chat function in C #
CSCI 2134
Zigzag scan
SQL injection (1) -- determine whether there are SQL injection vulnerabilities
Unspeakable Prometheus monitoring practice
Osnabrueck University | overview of specific architectures in the field of reinforcement learning
Jenkins configures IP address access
Leetcode 110 balanced binary tree
Safety tips - seat belt suddenly fails to pull? High speed police remind you how to use safety belts in a standardized way