CS计算机代考程序代写 // #include

// #include
#include
#include
#include

int main(int argc, char *argv[]){
DIR *dp;
struct dirent *dirp;

if(argc==1)
dp = opendir(“./”);
else
dp = opendir(argv[1]);

while ( (dirp=readdir(dp)) != NULL)
printf(“%s\n”, dirp->d_name);

closedir(dp);
exit(0);
}