·
Across the Great Wall, we can reach every corner in the world.

代码可以高亮:

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

public class Main {

    public static void main(String[] args) throws IOException, InterruptedException {
        String file = "word.txt";
        Map<String, Integer> wordCountMap = new HashMap<>();

        Files.lines(Paths.get(file))
                .forEach(line -> {
                    String[] words = line.split(" ");
                    for (String word : words) {
                        wordCountMap.merge(word.trim(), 1, Integer::sum);
                    }
                });
        wordCountMap.entrySet()
                .stream()
                .sorted(Map.Entry.comparingByValue())
                .skip(wordCountMap.size() - 10)
                .forEach(System.out::println);
    }
}
Replies
4

怎么高亮,没看到哪里有操作的地方,难道是显示 raw 然后去加个 hit?

编辑器代码块旁边有个输入框,可以选语言。

原来那个白色的框是填语言的,我还以为是个 bug, 怎么飘了个白块儿 laughing

建议在飘的框里加点灰色的提示文本