#include<stdio.h>
#include<string.h>
void main() { char cmd[20][20]={"dir","cd","md","rd","data","copy","help","quit"};
char cm[20];
printf("`````````````欢迎进入DOS系统``````````````");
while(1){
printf(" 输入:");
gets(cm);
if(strcmp(cm,cmd[0])==0)
{
printf("dir 查看当前所在目录的文件和文件夹 ");
}
else if(strcmp(cm,cmd[1])==0)
{
printf("cd 进入特定的目录 ");
}
else if(strcmp(cm,cmd[2])==0) {
printf("md 建立特定的目录 ");
}
else if(strcmp(cm,cmd[3])==0) {
printf("rd 删除特定的文件夹 ");
}
else if(strcmp(cm,cmd[4])==0) {
printf("data 设置日期命令 ");
}
else if(strcmp(cm,cmd[5])==0) {
printf("copy 复制文件 ");
}
else if(strcmp(cm,cmd[6])==0) {
printf("dir 查看当前所在目录的文件和文件夹 ");
printf("cd 进入特定的目录 ");
printf("md 建立特定的目录 ");
printf("rd 删除特定的文件夹 ");
printf("data 设置日期命令 ");
printf("copy 复制文件 ");
}
else if(strcmp(cm,cmd[7])==0) {
printf("退出!");
return;
}
else {
printf("输入错误,重新输入: ");
}
}
}