import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int TC = sc.nextInt();
int sum = 0;
sc.nextLine();
String str = sc.nextLine();
for (int tc = 1; tc <= TC; tc++) {
sum += str.charAt(tc-1) - '0';
}
System.out.println(sum);
}
}'일상' 카테고리의 다른 글
| 3052 : 나머지 (0) | 2021.08.10 |
|---|---|
| 10809 : 알파벳 찾기 (0) | 2021.08.04 |
| 11654 : 아스키 코드 (0) | 2021.08.04 |
| 15596 : 정수 N개의 합 (0) | 2021.08.04 |
| 4344 : 평균은 넘겠지 (0) | 2021.07.29 |