[백준2908_파이썬(python)] - 상수

경이·2021년 7월 5일
0

🔴 문제

상수


🟡 Sol

s1,s2 = input().split()
S1 = ''
S2 = ''

for i in range(len(s1)):
    S1 = S1 + (s1[2-i])
for i in range(len(s2)):
    S2 = S2 + (s2[2-i])

if(int(S1)>int(S2)):
    print(S1)
else:
    print(S2)

🟢 풀이

[::-1] 가 역순이래
이거쓰면 편함


🔵 Ref

https://ooyoung.tistory.com/72
https://itholic.github.io/python-reverse-string/

profile
이사중입니다!🌟https://velog.io/@devkyoung2

0개의 댓글

관련 채용 정보