解题思路:
注意事项:
QUWENHUI
参考代码:
package cn.hui.lanqiaobei02;
import java.util.Scanner;
public class Main1118
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
while (input.hasNext())
{
String str = input.nextLine();
char[] c = new char [10000];
int[] b = new int[10000];
for (int i = 0; i < str.length(); i++)
{
c[i] = str.charAt(i);
b[i] = c[i]-'0';
}
int sum = 0;
for (int i = 0; i < b.length; i++)
{
sum = sum +b[i];
}
System.out.println(sum);
}
}
}
0.0分
0 人评分