解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int n=0; String a = scanner.next(); for (int i = 0; i < a.length(); i++) n+= a.charAt(i)-'0'; System.out.println(n); } } }
0.0分
0 人评分