我这个为什么过不了 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();     }
点赞 评论

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务