我这个为什么过不了
public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Set<String> set = new HashSet<>();
        String str;
        int count = 0;
        while(input.hasNextLine() && count <= 50) {
            ++ count;
            str = input.nextLine();
            if(str == null || str.equals("")) break;
            String tmp [] = str.split(" ");
            for (String s : tmp) set.add(s);
        }
        System.out.println(set.size());
        set.clear();
    }