백준 15873번: 공백 없는 A+B
문제
문제 바로가기> 백준 15873번: 공백 없는 A+B
풀이
입력이 최대 10이기 때문에, 경우의 수를 나누면 간단하게 풀 수 있었다.
def solution():
import sys
AplusB = sys.stdin.readline().rstrip()
if(len(AplusB)==2): print(int(AplusB[0])+int(AplusB[1]))
elif(len(AplusB)==3):
if AplusB[1]=='0': print(10+int(AplusB[2]))
else: print(10+int(AplusB[0]))
else: print(20)
solution()
Author And Source
이 문제에 관하여(백준 15873번: 공백 없는 A+B), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@danbibibi/백준-15873번-공백-없는-AB저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)