`package suanfa_xiaoqiang1;
import java.util.Scanner;
public class P5015 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = "";
s = sc.nextLine();
int w=0;
String[] array = s.split("\\s+");
// System.out.println(array.length);
for (int i = 0; i < array.length; i++) {
w=w+array[i].length();
}
System.out.println(w);
}
}
1、数组里面的元素可以求个数,还可以再求出长度