当前位置:网站首页>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
边栏推荐
- [untitled]
- How to use STR function of C language
- If you have just joined a new company, don't be fired because of your mistakes
- Problems and solutions of several concurrent scenarios of redis
- System integration meets the three business needs of enterprises
- New year's first race, submit bug reward more!
- Enhanced for loop
- Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
- Code Execution Vulnerability - no alphanumeric rce create_ function()
- Site favorites
猜你喜欢
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
WordPress collection WordPress hang up collection plug-in
Jenkins configures IP address access
Lichuang EDA learning notes 14: PCB board canvas settings
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
Package details_ Four access control characters_ Two details of protected
Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
Recursive structure
Third party login initial version
What are the virtual machine software? What are their respective functions?
随机推荐
static hostname; transient hostname; pretty hostname
Session learning diary 1
WP collection plug-in free WordPress collection hang up plug-in
[development team follows] API specification
Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches
Code Execution Vulnerability - no alphanumeric rce create_ function()
基於.NetCore開發博客項目 StarBlog - (14) 實現主題切換功能
Which product is better if you want to go abroad to insure Xinguan?
Jenkins continuous integration environment construction V (Jenkins common construction triggers)
JVM family -- heap analysis
I stepped on a foundation pit today
[PaddleSeg 源码阅读] PaddleSeg Transform 的 Normalize操作
Leecode 122. Zuijia timing of buying and selling stocks ②
Webhook triggers Jenkins for sonar detection
7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages
[Valentine's Day confession code] - Valentine's Day is approaching, and more than 10 romantic love effects are given to the one you love
logistic regression
潘多拉 IOT 开发板学习(HAL 库)—— 实验6 独立看门狗实验(学习笔记)
Redis notes (I) Linux installation process of redis
Apple submitted the new MAC model to the regulatory database before the spring conference