문자열 - 숫자의 합


숫자의 합(11720)

import java.util.Scanner;

public class Main {
	
	Scanner in = new Scanner(System.in);
	int N = in.nextInt();
	String S = in.next();
	s.close();

	int sum = 0;

	for (int i=0; i < N; i++) {
		sum += S.charAt(i) - '0'
	}
	System.out.println(sum);
}