공부, 기록

6959. 이상한 나라의 덧셈게임 D4 파이썬 본문

코딩

6959. 이상한 나라의 덧셈게임 D4 파이썬

무는빼주세요 2020. 8. 23. 13:04

문제링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

T = int(input())
# 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다.
for test_case in range(1, T + 1):
    # ///////////////////////////////////////////////////////////////////////////////////
    nums = input()
    turn = 0
    answer=""
    while len(nums)!=1:
        nums=str(int(nums[0])+int(nums[1]))+nums[2::]
        turn+=1
    print('#{} {}'.format(test_case, "B" if turn %2 == 0 else "A"))
    # ///////////////////////////////////////////////////////////////////////////////////