当前位置:网站首页>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:

边栏推荐
猜你喜欢

2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?

【毕业设计】基于ESP32的在线墨水屏桌面摆件 -物联网 单片机 嵌入式

The older tester has just passed the "hurdle" of being 35 years old, and I want to tell you something from my heart

手把手教你编写性能测试用例

Win7怎么把控制面板添加到右键菜单

漫谈缺陷管理的自动化实践方案

由生物素参与的D-Biotinol,CAS号:53906-36-8具体特性说明

FITC标记生物素(FITC-生物素|CAS:134759-22-1)有哪些知识了?

拒绝“重复造轮子”,百度EasyDL让你玩转AI定制开发

数字孪生电力系统,可视化应用实现科学调度的电子设备
随机推荐
CAS:851113-28-5 (生物素-ahx-ahx-酪胺)
LSTM-based distributed energy generation prediction (Matlab code implementation)
pytest:如何在测试中编写和报告断言
算法---整数替换(Kotlin)
03|流程控制
[SUCTF 2019]CheckIn (.htaccess和.user.ini)
基于 LSTM 的分布式能源发电预测(Matlab代码实现)
Koa中间件next实现
Leecode-205. 同构字符串
字节技术面都过了,薪资都谈好了20K*13结果还是被刷了,问HR原因是。。。
【毕业设计】 基于Stm32的家庭智能监控系统 - 单片机 图像识别 人体检测 AI
vmware Exsi 网卡配置
数字孪生电力系统,可视化应用实现科学调度的电子设备
大龄测试员刚迈过了 35 岁这个“坎儿”,和大家说点儿心里话
Biotin-Cy2 Conjugate,生物素-Cy2 偶联物_Cy2 生物素偶联物
【剑指offer】第一题 第二题
字符统计柱状图
openEuler 知:abi 检测
Web性能测试模型小结
[C language] Address book "Static Memory Version"