#include <stdio.h>#include<string.h>voidMain ()/*Main function*/{Char*b[ One]={"dir","CD","MD","Rd","CLS","Date"," Time","Ren","Copy"," Help","quit"};/*pointer array Store keywords*/intPanCharCh1[],Char*j[ One]);Chara[Ten],*p=a;printf ("Welcome.........\npleas Enter a command!\nenter ' quit ' to quit.\nfor help,enter ' help '. \ n"); c1:printf ("c:\>"); scanf ("%s", a);p an (p,b); /*function Call*/if(strcmp (a,b[Ten])!=0)/*compares the input string whether the Quit End command*/ GotoC1;Elseprintf"Out of work!! \ n");}intPanCharCh1[],Char*j[ One])/*Child Functions*/{inti; for(i=0;i< One; i++)if(strcmp (ch1,j[i]) = =0)/*compares the input string to the array's keywords for equality*/{Switch(i) { Case 0:p rintf ("command name is Dir.\nit's function is a list file.\nit ' s an internal command.\nvolume in drive K gas no Label.\nvolume Serial number is 60f0-6c24\n\n"); Break; Case 1:p rintf ("command name is Cd.\nit's function is the change directory.\nit ' s an internal command.\n"); Break; Case 2:p rintf ("command name is Md.\nit's function is creat a new Directory.\nit's an internal command.\n"); Break; Case 3:p rintf ("command name is Rd.\nit's function is delete a directory which is Empty.\nit's an internal command.\n"); Break; Case 4:p rintf ("command name is Cls.\nit's function is a clean screen\nit ' s a internal command.\n"); Break; Case 5:p rintf ("command name is Date.\nit's function is show Date.\nit's an internal command.\n"); Break; Case 6:p rintf ("command name is Time.\nit's function is Shio Time.\nit's an internal command.\n"); Break; Case 7:p rintf ("command name is Ren.\nit's function is rename a file.\nit ' s an internal command.\n"); Break; Case 8:p rintf ("command name is Copy.\nit's function is copy Files.\nit's an internal command.\n"); Break; Case 9:p rintf ("dir\tcd\tmd\trd\tcls\ndate\ttime\tren\tcopy\nenter \ "Quit\" to quit this program!! \ n"); Break; Case Ten:p rintf ("Thanks for using it,bye!! \ n"); Break;}return 1;} printf ("No This one!! \nnot a internal commal.\n");return 0;}
Summary: Fortunately, not difficult.
A summary of the experiment