根据文件层次,输出空格数~ public String getSpace(int level) { // getSpace(level)用来加缩进的!根据层次! StringBuilder sb=new StringBuilder(); sb.append("|---"); for (int i = 0; i < level; i++) { //每次在头部插入"| " sb.insert(0, "| "); } return sb.toString(); } @Test...