From f318e7e8af64f6e47161031a31662554e7864843 Mon Sep 17 00:00:00 2001 From: kim_yubin Date: Sun, 4 Nov 2018 14:07:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80=20'3-6=20=EC=97=B0=EC=86=8D?= =?UTF-8?q?=EB=90=9C=20=EC=9E=90=EC=97=B0=EC=88=98=EC=9D=98=20=ED=95=A9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3-6 연속된 자연수의 합 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 3-6 연속된 자연수의 합 diff --git a/3-6 연속된 자연수의 합 b/3-6 연속된 자연수의 합 new file mode 100644 index 0000000..be80f23 --- /dev/null +++ b/3-6 연속된 자연수의 합 @@ -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) + \ No newline at end of file