[BOJ]1720:数字の和



🔒 例

>> 1
>> 1
	
1

>> 5
>> 54321

15

>> 25
>> 7000000000000000000000000

7

>> 11
>> 10987654321

46

🔧 に答える

1. N = int(sys.stdin.readline().rstrip())
2. nums = sys.stdin.readline().rstrip()
3. for문

🔑 答案用紙

import sys

N = int(sys.stdin.readline().rstrip())
nums = sys.stdin.readline().rstrip()

sum = 0
for i in range(len(nums)):
	sum += int(nums[i])
print(sum)

💡 コンセプト

### split
a.split()			# split by " "
a.split("\n")   	# split by "\n"\
a.split("\n", 2)	# split by "\n" 2 times
a.split(sep="\n", maxsplit=2)