#include #include #include #include #include #include using namespace std; int main() { DIR* dp=opendir("/bin"); vector v; if (dp!=NULL) { struct dirent* dent; do{ dent = readdir(dp); if (dent!=NULL)v.push_back(dent->d_name); }while(dent!=NULL); closedir(dp); } sort(v.begin(),v.end()); for(int i = 0;i < v.size();i++)cout << v[i] << endl; return 0; }