读书人

请教这段程序怎么编

发布时间: 2012-02-19 19:43:38 作者: rapoo

请问这段程序如何编?
搜索D:\FILE\AA,
如AA文件夹存在,输出“D:\FILE\AA存在”,
否则输出“D:\FILE\AA不存在”。

注意搜索的是文件夹。
希望帮忙


[解决办法]
#include <stdio.h>
#include <stdlib.h>

int main(){
int code;
system( "echo off ");
code=system( "cd D:\\FILE\\AA ");

if(code){
printf( "The directory is not exist! ");
exit(0);
}
printf( "This directory is exist! ");

system( "pause ");
return 0;
}

读书人网 >C语言

热点推荐