Skip to content

Commit

Permalink
[#3] 2021.12.15 백준단계별4. while문
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesuuou committed Dec 15, 2021
1 parent 5d38a1c commit 177d1ed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Boj/while문/10951.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
while True:
try:
A, B= map(int,input().split())
print(A+B)
except EOFError:
break
5 changes: 5 additions & 0 deletions Boj/while문/10952.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
while True:
a, b = map(int, input().split())
if a == 0 and b == 0:
break
print(a+b)
18 changes: 18 additions & 0 deletions Boj/while문/1110.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
n = input()
cycle = 0
new = int(n)

while True:

# 두 자리를 합함
sum = 0
for i in str(new):
sum = sum + int(i)

# 새로운 수
new = (new%10 * 10) + sum%10
cycle = cycle + 1
if new == int(n):
break

print(cycle)

0 comments on commit 177d1ed

Please sign in to comment.