輸入n,求1+2!+3!+...+n!的和

輸入n,用遞推法編程求1+2!+3!+…+n!的和並輸出 [輸入樣例] 5 [輸出樣例] 153python n =int(input('Input:')) sum = 0 term = 1 for i in range(1,n+1): term *= i sum += term print(sum)
相關文章
相關標籤/搜索