实验报告_ASE_lab2
来源:互联网 发布:胡雪岩 盛宣怀 知乎 编辑:程序博客网 时间:2024/06/05 03:34
实验题目:命令行菜单小程序
实验目的:加强代码规范习惯
实验步骤:
- 使用vim编辑器编写C程序,源代码在文末。
可在vim中设置tab代表的空格数:
输入命令::e ~/.vimrc
编译运行,测试结果
- 提交git
Coding版本库地址
附:menu.c源代码
#include <stdio.h>#include <stdlib.h>int main(){ char cmd[128]; while (1) { scanf("%s",cmd); if(strcmp(cmd,"help") == 0) { printf("You have typed 'help'.\n" "This is the command list:\n" "command1\n" "command2\n" "command3\n" "command4\n" "command5\n" "command6\n" "command7\n" "command8\n" "quit\n" ); } else if(strcmp(cmd,"quit") == 0) { exit(0); } else if(strcmp(cmd,"command1") == 0) { printf("This is command1.\n"); } else if(strcmp(cmd,"command2") == 0) { printf("This is command2.\n"); } else if(strcmp(cmd,"command3") == 0) { printf("This is help command3.\n"); } else if(strcmp(cmd,"command4") == 0) { printf("This is help command4.\n"); } else if(strcmp(cmd,"command5") == 0) { printf("This is help command5.\n"); } else if(strcmp(cmd,"command6") == 0) { printf("This is help command6.\n"); } else if(strcmp(cmd,"command7") == 0) { printf("This is help command7.\n"); } else if(strcmp(cmd,"command8") == 0) { printf("This is help command8.\n"); } else { printf("wrong command!\n"); } } return 0;}
阅读全文
0 0
- 实验报告_ASE_lab2
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 实验报告
- 第二次实验 实验报告
- 实验五:实验报告
- 《数据结构》实验一 实验报告
- 数据结构 实验一实验报告
- 网易云课堂【第九章 Spring Boot 缓存】
- oracle 数据库 错误 ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务 解决办法
- iOS开发
- Matlab画图教程
- 欢迎使用CSDN-markdown编辑器
- 实验报告_ASE_lab2
- 阿里云解析二级域名
- jQuery写插件入门
- thinkPHP中M()和D()的区别
- Jmeter-BeanShell PostProcessor提取请求及响应结果并保存到本地文件
- 9.24 NOIP模拟题(By liu_runda)
- python的BIF和保留字(三)
- vue-cli 中使用Vuex
- BZOJ 1257 计数