Programming/Python & Data Structures
[Baekjoon/Python3] 11720번 숫자의 합
HooNeee
2020. 12. 7. 00:44
[Baekjoon/Python3] 11720번 숫자의 합
11720번: 숫자의 합
첫째 줄에 숫자의 개수 N (1 ≤ N ≤ 100)이 주어진다. 둘째 줄에 숫자 N개가 공백없이 주어진다.
www.acmicpc.net
N = int(input())
inp = int(input())
nums = list(map(int, str(inp)))
res = 0
for i in nums:
res += i
print(res)