관리 메뉴

솜씨좋은장씨

[BaekJoon] 3486번 : Adding Reversed Number (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 3486번 : Adding Reversed Number (Python)

솜씨좋은장씨 2022. 9. 11. 10:10
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Adding Reversed Number 입니다.

 

3486번: Adding Reversed Numbers

The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure some tragedies into comedies. Obviously, this work is very hard beca

www.acmicpc.net

👨🏻‍💻 코드 ( Solution )

def reverse_number(num):
    return int(str(num)[::-1])

def adding_reversed_numbers(num1, num2):
    reversed_num1 = reverse_number(num=num1)
    reversed_num2 = reverse_number(num=num2)
    
    return reverse_number(num=(reversed_num1 + reversed_num2))


if __name__ == "__main__":
    for _ in range(int(input())):
        num1, num2 = map(int, input().split())
        
        print(adding_reversed_numbers(num1=num1, num2=num2))
 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

Comments