문제출처 : https://www.acmicpc.net/problem/11720
code
#include <stdio.h> int main() { char arr[100] = { 0 }; int N, sum = 0; scanf("%d", &N); scanf("%s", &arr); for (int i = 0; i < N; i++) sum += arr[i]-48; printf("%d", sum); return 0; }