第五組 ```python= a = int(input('n> ')) #將輸入的n由字串改為數值,並假設為變數a b = 0 #提供一個變數(用來累加) for i in range(0,a+1,1): #它會數到(a+1)-1 #若寫a,它只會數到a-1 b=b+i #會加到a #i的值會依序為0~a print(b) #答案 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up