public static void main(String[] args){
int ri, repeat;
int number, sum,n;
Scanner in=new Scanner(System.in);
repeat=in.nextInt();
for(ri=1; ri<=repeat; ri++){
n=in.nextInt();
/*--------------------*///此处填空
number = String.valueOf(n).length();
sum = 0;
while(n/10 != 0){
sum += n%10;
n = n/10;
if(n/10 ==0){
sum += n;
}
}
System.out.println("number="+number+", sum="+sum);
}
}
自己看看吧。。