[백준] - 1357번: 뒤집힌 덧셈(Python)

병찬·2022년 4월 6일
0

Baekjoon Online Judge

목록 보기
2/18
post-thumbnail

문제📝


풀이💡

  • a와 b를 입력받고 슬라이스를 이용해서 뒤집어준다.
  • a+b 후 슬라이스를 이용해서 뒤집어준다.

코드💻

# 백준 Bronze1 - 1357(뒤집힌 덧셈)
# 문제링크: https://www.acmicpc.net/problem/1357

a,b = input().split()
a = int(a[::-1]) 
b = int(b[::-1]) 
print(int(str(a+b)[::-1])) 

결과😎


느낀점👨‍💻

파이썬의 슬라이스를 이용해서 쉽게 해결할 수 있었다.


Sinbmil의 알고리즘 문제 코드

-> https://github.com/Sinbmil/Algorithm-Study

profile
코딩을 열심히 하고 있습니다:)

0개의 댓글

Powered by GraphCDN, the GraphQL CDN