Constructs a string tokenizer for the specified string. The tokenizer uses the default delimiter set, which is " \t\n\r\f": the space character, the tab character, the newline character, the carriage-return character, and the form-feed character. Delimiter characters themselves will not be treated as tokens.
for (int i = 0; i < S.length(); i++) { s[i] = t.nextToken();//运行时说空指针错误了...我不明白 你既然用了token,为啥还要去循环S, 你的StringTokenizer只会以默认的" \t\n\r\f"去分割,而不是把每个字符分割