/**//* 上海交通大学cs的一道复试题 原题目如下: 给你一串路径,譬如 ac ade bcst d 你把这些路径中蕴涵的目录结构给画出来,子目录直接列在父目录下面,并比父目录向右 缩一格,就象这样 a b c d e b cst d 程序通过调试没有问题 只不过员题目有一点要求排序,我这里使用了指针来存储在VECTOR里,使用SORT的时候就出现问题了, 有解决意见的可以在后面评论 作者:Albert */ #include <iostream> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <fstream> usingnamespace std; class Directory ...{
public: bool hasSubDirectoy(string dname) ...{
int n = subdirs.size(); if ( n ==0 ) returnfalse