owner:卧槽 代码量这么大 还好我没参加
 投递网易等公司10个岗位
投递网易等公司10个岗位0 点赞 评论 收藏   
分享
 0 点赞 评论 收藏   
分享
 2016-08-02 22:05
  上海交通大学 Java  gloomy:我用BufferedReader的ready()方法判断搞定的
public class Main {
	private static String regex = "\\s";
	public static void main(String[] args) throws IOException {
		Set<String> set = new HashSet<String>();
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		for (int i = 0; i < 50; i++) {
			if (in.ready()) {
				String text = in.readLine();
				String[] arr = text.split(regex);
				for (String val : arr) {
					set.add(val);
				}
			} else {
				break;
			}
		}
		System.out.println(set.size());
		in.close();
	}
}
 投递网易等公司10个岗位
投递网易等公司10个岗位0 点赞 评论 收藏   
分享
 创作者周榜
更多 
 关注他的用户也关注了:
