[BOJ] 2908: μƒμˆ˜

ohhj1999Β·2021λ…„ 7μ›” 28일
0

[BOJ] Algorithm Solving

λͺ©λ‘ 보기
11/62
post-thumbnail

πŸ”’ 예제

>> 734 893

437

>> 221 231

132

>> 839 237

938

πŸ”§ 풀이

1. a, b = sys.stdin.readline().split()
2. sliceλ₯Ό 톡해 λ¬Έμžμ—΄ reverse, intν˜• λ³€ν™˜
	2.1 a = int(a[::-1])
    2.2 b = int(b[::-1])
3. λŒ€μ†Œ 비ꡐ

πŸ”‘ λ‹΅μ•ˆ

import sys

a, b = sys.stdin.readline().split()
a = int(a[::-1])
b = int(b[::-1])

print(max(a, b))

πŸ’‘ κ°œλ…

### slicing μ‘μš©
# a[start:stop:step]
a = 'hello'
print(a[:2])	# he
print(a[::-1])	# olleh
print(a[3::-1]) # lleh
print(a[:1:-1])	# oll

0개의 λŒ“κΈ€