https://www.acmicpc.net/problem/10824
10824번: 네 수
첫째 줄에 네 자연수 A, B, C, D가 주어진다. (1 ≤ A, B, C, D ≤ 1,000,000)
www.acmicpc.net
split()하면 자동으로 list에 넣어지고 넣어질때 문자형 타입이라 바로 더하고 int()해주면 끝!
import sys
input = sys.stdin.readline().split()
print(int(input[0] + input[1]) + int(input[2] + input[3]))
'공부 > 알고리즘' 카테고리의 다른 글
[알고리즘][백준] 2609번 최대공약수와 최소공배수 - 파이썬(python) 풀이 (1) | 2024.02.27 |
---|---|
[알고리즘][백준] 11656번 접미사 배열 - 파이썬(python) 풀이 (0) | 2024.02.27 |
[알고리즘][백준] 11655번 ROT13 - 파이썬(python) 풀이 (0) | 2024.02.27 |
[알고리즘][백준] 10820번 문자열 분석 - 파이썬(python) 풀이 (1) | 2024.02.27 |
[알고리즘][백준] 10808번 알파벳 개수 - 파이썬(python) 풀이 (1) | 2024.02.26 |