추가 '3-6 연속된 자연수의 합'
This commit is contained in:
parent
c62ed1af6e
commit
f318e7e8af
|
|
@ -0,0 +1,15 @@
|
||||||
|
inputNum=int(input("자연수 입력 : "))
|
||||||
|
result=[]
|
||||||
|
|
||||||
|
for a in range(1, inputNum + 1):
|
||||||
|
result=[]
|
||||||
|
u=0
|
||||||
|
t=a
|
||||||
|
|
||||||
|
while u<=inputNum:
|
||||||
|
u=u+t
|
||||||
|
result.append(t)
|
||||||
|
t+=1
|
||||||
|
if u==inputNum:
|
||||||
|
print(result)
|
||||||
|
|
||||||
Loading…
Reference in New Issue