Head vs breakz

[code] - 백준 while문 10952,10951,1110 python 본문

Head/Code

[code] - 백준 while문 10952,10951,1110 python

headbreakz 2020. 3. 18. 19:24

10952

#while
#10952
while(True):
    a ,b = map(int, input().split())
    if a == 0 and b == 0 :
        break
        
    else :
        print(a+b)

10951

#10951
while(True):
    try :
        
        a ,b = map(int, input().split())
    except :
        break
    print(a+b)

1110

#1110
a = int(input())
b = a//10
c = a%10
new_a = -100
count = 0
while(new_a != a):
    count += 1
    new_a = c*10 + (b+c)% 10
    b = new_a//10
    c = new_a%10
    
print(count)
Comments