BOJ - 17202 - 핸드폰 번호 궁합

Updated:

import sys

def solution():
    A = str(input())
    B = str(input())

    phone = ''
    for i in range(8):
        phone += A[i]
        phone += B[i]

    while len(phone) > 2:
        temp = ''
        for i in range(len(phone)-1):
            temp += str((int(phone[i]) + int(phone[i+1]))%10)
        phone = temp
    print(phone)
solution()

https://www.acmicpc.net/problem/17202

Categories:

Updated:

Leave a comment