当前位置:网站首页>C language structure, function and pointer exercise (simple address book)
C language structure, function and pointer exercise (simple address book)
2022-08-10 01:47:00 【BSP Junior Primary School Monk】
#include #include typedef struct{char name[20];long long phone;char sex[10];char dress[20];int age;}Person;Person person_arr[20]={{"Xiong Da",10086,"Male","Henan",24},{"Xiong Er", 10010, "Male", "Shaanxi", 23},{"Xiong San",911,"Male","Hubei",25}};void add(){int i,n;printf("Please enter how many address book friends you need to add this time:\n");scanf("%d",&n);for(i=0;iperson_arr[j+1].age){temp=person_arr[j];person_arr[j]=person_arr[j+1];person_arr[j+1]=temp;}}}}int main(){int n=100;while(n != 0){printf("The information of this address book list is as follows:\n");print();printf("The function is as follows:\n");printf("1. Add friends 2. Delete friends\n");printf("3. Search friends 4. Modify friends\n");printf("5. Print friends 6. Sort contacts\n");printf("0, exit\n");scanf("%d", &n);switch(n){case 1:add();break;case 2:del();break;case 3:seek();break;case 4:modify();break;case 5:print();break;case 6:classfy();break;default :break;}}return 0;}
Running result:
边栏推荐
- 有PEG-Biotin参与的(CAS:1778736-18-7)Biotin-PEG4-OH广泛用于分子靶点检测
- WPF DataGrid using data templates
- 渗透测试与攻防对抗——漏洞扫描&逻辑漏洞(Part1)
- Leetcode81. 搜索旋转排序数组 II
- 聚焦热点 | ISC 2022软件供应链安全治理与运营论坛圆满落幕
- 拒绝“重复造轮子”,百度EasyDL让你玩转AI定制开发
- Redis 非关系型数据库学习(一) ---- Redis 的安装
- labelme标注的json标签转txt格式
- 基于ABP的AppUser对象扩展
- 3.1 - 程序设计语言 3.2 - 高级语言的特点及引用 3.3 - 静态/动态类型语言
猜你喜欢
生物素叠氮化物中的(CAS:1527486-16-3TAMRA-azide-PEG3-Biotin)反应的特点!
快速响应性智能型/智能响应性聚乙二醇纳米/还原响应型水凝胶的研究与制备
手把手教你编写性能测试用例
今日睡眠质量记录61分
【毕业设计】 基于Stm32的家庭智能监控系统 - 单片机 图像识别 人体检测 AI
Leetcode79. 单词搜索
数据的存储——C语言
服装店管理系统如何推送活动?
CST Studio Suite 2021 software installation package and installation tutorial
Next.js获取路由参数及styled-jsx 的使用
随机推荐
Leetcode80. 删除有序数组中的重复项 II
router路由
安全知识培训——消防安全
Project (7) - PolarSeg point cloud semantic segmentation
FITC标记生物素(FITC-生物素|CAS:134759-22-1)有哪些知识了?
LSTM-based distributed energy generation prediction (Matlab code implementation)
地雷数量求解
数字孪生电力系统,可视化应用实现科学调度的电子设备
Today's sleep quality record 61 points
基于 LSTM 的分布式能源发电预测(Matlab代码实现)
技术分享 | 接口自动化测试如何处理 Header cookie
字符统计柱状图
Characteristics of the (CAS:1527486-16-3TAMRA-azide-PEG3-Biotin) reaction in biotin azide!
二进制、八进制、十进制、十六进制之间的转换
Leetcode79. 单词搜索
-红与黑-
断开和服务器共享连接的方法「建议收藏」
dlopen failed: library “libtaml.so“ not found
输入的这些数是否对称
PEG 衍生物Biotin-PEG1-OH(cas:95611-10-2,2-生物素氨基乙醇)优势说明