import java.util.Scanner;//(不同的)单词数
public class HDU2072 { public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = 0;
String s;
String str = "";
while (true) {
while (sc.hasNext()) {
s = sc.next();
if (s.equals("#"))
break;
if (!str.contains(s)) {
str += s;
count++;
}
}
System.out.println(count);
}
}}
这样说我超时,到底要怎样嘛?