当前位置:网站首页>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
边栏推荐
- [Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
- Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
- 【.NET+MQTT】.NET6 環境下實現MQTT通信,以及服務端、客戶端的雙邊消息訂閱與發布的代碼演示
- static hostname; transient hostname; pretty hostname
- SQL injection (1) -- determine whether there are SQL injection vulnerabilities
- CSCI 2134
- Amélioration de l'efficacité de la requête 10 fois! 3 solutions d'optimisation pour résoudre le problème de pagination profonde MySQL
- Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
- Code Execution Vulnerability - no alphanumeric rce create_ function()
- [database I] database overview, common commands, view the table structure of 'demo data', simple query, condition query, sorting data, data processing function (single row processing function), groupi
猜你喜欢

Jenkins configures IP address access

Management and thesis of job management system based on SSM

Record a problem that soft deletion fails due to warehouse level error

Li Chuang EDA learning notes IX: layers

Hospital network planning and design document based on GLBP protocol + application form + task statement + opening report + interim examination + literature review + PPT + weekly progress + network to

Jenkins continuous integration environment construction V (Jenkins common construction triggers)

(column 23) typical C language problem: find the minimum common multiple and maximum common divisor of two numbers. (two solutions)

Explain AI accelerator in detail: why is this the golden age of AI accelerator?

JVM family -- monitoring tools

Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
随机推荐
[Valentine's Day confession code] - Valentine's Day is approaching, and more than 10 romantic love effects are given to the one you love
Eh, the log time of MySQL server is less than 8h?
logistic regression
查詢效率提昇10倍!3種優化方案,幫你解决MySQL深分頁問題
I stepped on a foundation pit today
Want to do something in production? Then try these redis commands
How to use STR function of C language
Unspeakable Prometheus monitoring practice
Enhanced for loop
2022 examination summary of quality controller - Equipment direction - general basis (quality controller) and examination questions and analysis of quality controller - Equipment direction - general b
Aperçu du code source futur - série juc
New year's first race, submit bug reward more!
MySQL backup notes
Redis notes (I) Linux installation process of redis
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
Redis transaction
1day vulnerability pushback skills practice (3)
Recursive structure
[development team follows] API specification