42实验一

 1  1 #include<stdio.h>
 2  2 #include<string.h>
 3  3 void main() /*主函数*/
 4  4 {
 5  5 char *b[11]={"dir","cd","md","rd","cls","date","time","ren","copy","help", "quit"}; /*指针数组存储关键字*/
 6  6 int pan(char ch1[],char *j[11]);
 7  7 char a[10],*p=a;
 8  8 printf("Welcome.........\nPleas enter a command!\nEnter ‘quit‘ to quit.\nFor help,Enter ‘help‘.\n");
 9  9 c1: printf("c:\>$");
10 10 scanf("%s",a);
11 11 pan(p,b); /*函数调用*/
12 12 if(strcmp(a,b[10])!=0) /*比较输入的字符串是否quit结束命令*/ goto c1;
13 13 else printf("out of work!!\n");
14 14 }
15 15 int pan(char ch1[],char *j[11]) /*子函数*/
16 16 {
17 17 int i;
18 18 for( i=0;i<11;i++)
19 19 if(strcmp(ch1,j[i])==0) /*比较输入的字符串与数组的关键字是否相等*/
20 20 {
21 21 switch(i)
22 22 {
23 23 case 0:printf("command name is dir.\nIt‘s function is list file.\nIt‘s an internal command.\nVolume in drive K gas no label.\nVolume Serial Number is 60F0-6C24\n\n");break;
24 24 case 1:printf("command name is cd.\nIt‘s function is change directory.\nIt‘s an internal command.\n");break;
25 25 case 2:printf("command name is md.\nIt‘s function is creat a new directory.\nIt‘s an internal command.\n");break;
26 26 case 3:printf("command name is rd.\nIt‘s function is delete a directory which is empty.\nIt‘s an internal command.\n");break;
27 27 case 4:printf("command name is cls.\nIt‘s function is clean screen\nIt‘s an internal command.\n");break;
28 28 case 5:printf("command name is date.\nIt‘s function is show date.\nIt‘s an internal command.\n");break;
29 29 case 6:printf("command name is time.\nIt‘s function is shio time.\nIt‘s an internal command.\n");break;
30 30 case 7:printf("command name is ren.\nIt‘s function is rename a file.\nIt‘s an internal command.\n");break;
31 31 case 8:printf("command name is copy.\nIt‘s function is copy files.\nIt‘s an internal command.\n");break;
32 32 case 9:printf("dir\tcd\tmd\trd\tcls\ndate\ttime\tren\tcopy\nEnter \" quit\" to quit this program!!\n");break;
33 33 case 10:printf("Thanks for using it,bye!!\n");break;
34 34 }
35 35 return 1;}
36 36 printf("No this one!!\nNot a internal commal.\n");return0;
37 37 }

心得:感觉良好

时间: 2024-08-29 07:22:09

42实验一的相关文章

[nRF51822] 7、基础实验代码解析大全(前十)

实验01 - GPIO输出控制LED 引脚输出配置:nrf_gpio_cfg_output(LED_1); 引脚输出置高:nrf_gpio_pin_set(LED_1); 引脚电平转换:nrf_gpio_pin_toggle(LED_1); 毫秒延时:nrf_delay_ms(100); 1 int main(void) 2 { 3 nrf_gpio_cfg_output(LED_1);//配置P0.21为输出 4 nrf_gpio_pin_set(LED_1); //指示灯D1初始状态为熄灭

CCNP路由专题实验之EIGRP篇,51微博首发!敬请关注连载!

目  录 实验1:EIGRP基本配置和常用show命令复习.. 1 实验2:EIGRP邻居关系建立的条件分析.. 6 实验3:EIGRP多AS号问题研究.. 11 实验4:EIGRP路由条目类型与管理距离修改.. 15 实验5:EIGRP自动汇总和手工汇总.. 19 实验6:EIGRP路由泄露.. 22 实验7:EIGRP浮动汇总路由.. 23 实验8:EIGRP等价负载均衡.. 26 实验9:EIGRP非等价负载均衡.. 29 实验10:EIGRP默认路由.. 32 实验11:EIGRP st

201771010126 王燕《面向对象程序设计(Java)》第十七周学习总结

实验十七  线程同步控制 实验时间 2018-12-10 1.实验目的与要求 (1) 掌握线程同步的概念及实现技术: ? 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案: 多线程并发运行不确定性问题解决方案:

实验4-2:掌握Android应用调试方法、添加新界面

第五章.添加新界面 代码清单5-1 添加字符串资源(strings.xml) 代码清单5-2 第二个activity的布局组件定义(activity_cheat.xml) 代码清单5-3 覆盖onCreate(...)方法(CheatActivity.java) 代码清单5-4 在manifest配置文件中声明CheatActivity(AndroidManifest.xml) 代码清单5-5 默认布局中添加cheat按钮(layout/activity_quiz.xml) 代码清单5-6 水平

mongodb3.4--2分片配置实验 wiredTiger -账户管理

# update by csc 20170217 #opensystem  centos  6.5 64 bit tar -xvzf   mongodb-linux-x86_64-rhel62-3.4.2.gz  -C /usr/local/ mv  /usr/local/mongodb-linux-x86_64-rhel55-3.4.2  /usr/local/mongodb echo 'export PATH=$PATH:/usr/local/mongodb/bin' >>/etc/pro

基础实验4-2.3 二叉树的非递归遍历 (25分)

本题要求用非递归的方法实现对给定二叉树的 3 种遍历. 函数接口定义: void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct TNode{ ElementType

基础实验4-2.1 树的同构 (25分)--二叉树

解题思路: 1.建二叉树(静态链表) 不作为任何结点的孩子结点的即为根结点 2.判断是否同构 1)空树,同构 2)两棵树中若只有其中一棵是空树,则不同构 3)两棵树的根结点值不等,不同构 4)若左子树均空,则递归判断右子树 5)若左子树均不空, 比较左子树的根结点值 相等:则没有交换左右子树,判断树1左子树和树2左子树.树1右子树和树2右子树 不等:交换左右子树,判断树1左子树和树2右子树,树1右子树和树2左子树 #include <stdio.h> #include <string.h

基础实验4-2.6 目录树 (30分)- 建树+先序遍历

解题思路:采用将多叉树转化为二叉树的方法(即利用孩子兄弟的结点结构)建立二叉树,最后再先序遍历输出即可 #include <stdio.h> #include <malloc.h> #include <string.h> struct TNode { int space;//记录打印空格数 int prior;//标记是文件还是目录,文件优先级0,目录优先级1(优先级大的优先) char name[261];//文件名 struct TNode *son,*sib;//

嵌入式软件设计第11次实验报告

学号:140201126             姓名:杨鹏飞 组别:第2组                实验地点:D19 一.实验目的: 1.了解短信AT指令的使用方法. 2.掌握使用短信AT指令驱动SIM900A发送和接收短信的方法. 二.实验内容: 1.使用AT命令进行模块测试,发送和接收短信. 2.编写程序利用触摸屏完成固定号码短信的发送和接收.(需要加上AT测试命令模块.手机SIM卡检测模块.手机信号质量检测模块等等.) 三.实验过程描述及结果展示: 短信常用AT指令 程序代码: #