• 数据结构从入门到实战——顺序表的应用


    目录

    一、基于动态顺序表实现通讯录

    二、代码实现

    2.1 通讯录的初始化

    2.2 通讯录的销毁 

    2.3 通讯录的展示

    2.4 通讯录添加联系人信息

    2.5 通讯录删除联系人信息

    2.6 通讯录修改联系人信息 

    2.7 通讯录的查找联系人信息

    2.8 将通讯录中联系人信息保存到文件中 

    2.9 从文件中读取数据到通讯录中

    三、将上述代码做成一个小游戏 


    正文开始 

    一、基于动态顺序表实现通讯录

     C语言基础要求:结构体、动态内存管理、顺序表、文件操作

    1.1、功能要求 

    1.  至少能够存储100个人的通讯信息
    2.  能够保存用户户信息:名字、性别、年龄、电话、地址等
    3.  通讯录的初始化
    4.  通讯录的销毁
    5.  通讯录增加联系人信息
    6.  删除指定联系人
    7.  查找制定联系人
    8.  修改指定联系人
    9.  显示联系人信息 

    二、代码实现

    2.1 通讯录的初始化

     Contact.h——主要用来声明实现通讯录结构,以及声明通讯录的方法

    1. #pragma once
    2. #define NAME_MAX 20
    3. #define GENDER_MAX 10
    4. #define TEL_MAX 20
    5. #define ADDR_MAX 100
    6. //定义联系人的数据结构
    7. //姓名, 性别,年龄 , 电话 , 地址
    8. typedef struct personInfo
    9. {
    10. char name[NAME_MAX];
    11. char gender[GENDER_MAX];
    12. int age;
    13. char tel[TEL_MAX];
    14. char addr[ADDR_MAX];
    15. }peoInfo;
    16. //首先得先给通讯录起个名字
    17. typedef struct SeqList Contact;
    18. //1.通讯录的初始化
    19. void ContactInit(Contact* con);

     Contact.c——实现通讯录的方法

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "Contact.h"
    3. #include "SeqList.h"
    4. //1.通讯录的初始化
    5. void ContactInit(Contact* con)
    6. {
    7. //实际上就是对顺序表进行初始化
    8. SLInit(con);//这里的方法是上一篇中的方法
    9. }

    2.2 通讯录的销毁 

    Contact.h 

    1. //2.通讯录的销毁
    2. void ContactDestroy(Contact* con);

    Contact.c

    1. //2.通讯录的销毁
    2. void ContactDestroy(Contact* con)
    3. {
    4. SLDestroy(con); //同上
    5. }

    2.3 通讯录的展示

    Contact.h 

    1. //3.展示通讯录数据
    2. void ShowContact(Contact* con);

    Contact.c 

    1. //3. 展示通讯录数据
    2. void ShowContact(Contact* con)
    3. {
    4. //表头:姓名 性别 年龄 电话 地址
    5. printf("%s %s %s %s %s\n", "姓名", "性别", "年龄", "电话", "地址");
    6. //遍历通讯录,按照格式打印每个联系人的数据
    7. for (int i = 0; i < con->size; i++)
    8. {
    9. printf("%3s %4s %4d %4s %4s\n",
    10. con->arr[i].name,
    11. con->arr[i].gender,
    12. con->arr[i].age,
    13. con->arr[i].tel,
    14. con->arr[i].addr
    15. );
    16. }
    17. }

    2.4 通讯录添加联系人信息

    Contact.h

    1. //4.通讯录添加数据
    2. void ContactAdd(Contact* con);

    Contact.c  

    1. //4.通讯录添加数据
    2. void ContactAdd(Contact* con)
    3. {
    4. //首先我们得获取用户输入的内容:姓名+性别+年龄+电话+地址
    5. peoInfo Info;
    6. printf("请输入你想要添加联系人的姓名:");
    7. scanf("%s", Info.name);
    8. printf("请输入你想要添加联系人的性别:");
    9. scanf("%s", Info.gender);
    10. printf("请输入你想要添加联系人的年龄:");
    11. scanf("%d", &Info.age);
    12. printf("请输入你想要添加联系人的电话:");
    13. scanf("%s", Info.tel);
    14. printf("请输入你想要添加联系人的地址:");
    15. scanf("%s", Info.addr);
    16. //获取到数据之后,就需要往通讯录中写入
    17. SLPushBack(con, Info);
    18. }

    test.c ——测试文件

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "SeqList.h"
    3. #include "Contact.h"
    4. Contact_test01()
    5. {
    6. Contact con;
    7. //1.通讯录得初始化
    8. ContactInit(&con);
    9. //4.尾插联系人信息
    10. ContactAdd(&con);
    11. //3.展示所以联系人信息
    12. ShowContact(&con);
    13. //2.通讯录的销毁
    14. ContactDestroy(&con);
    15. }
    16. int main()
    17. {
    18. Contact_test01();
    19. return 0;
    20. }

     

    2.5 通讯录删除联系人信息

    Contact.h 

    1. //5.通讯录删除数据
    2. void ContactDel(Contact* con);

    Contact.c   

    1. //5.通讯录删除数据
    2. void ContactDel(Contact* con)
    3. {
    4. //想要删除,就需要将他给找出来
    5. printf("请输入你想要删除联系人得姓名:");
    6. char name[NAME_MAX];
    7. scanf("%s", name);
    8. int ret = FindbyName(con, name);
    9. if (ret < 0)
    10. {
    11. printf("要删除得联系人数据不存在!\n");
    12. return;
    13. }
    14. SLErase(con, ret);
    15. printf("删除成功!\n");
    16. }

    test.c

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "SeqList.h"
    3. #include "Contact.h"
    4. Contact_test01()
    5. {
    6. Contact con;
    7. //1.通讯录得初始化
    8. ContactInit(&con);
    9. //4.尾插联系人信息
    10. ContactAdd(&con);
    11. //3.展示所以联系人信息
    12. ShowContact(&con);
    13. //5.删除联系人信息
    14. ContactDel(&con);
    15. ShowContact(&con);
    16. //2.通讯录的销毁
    17. ContactDestroy(&con);
    18. }
    19. int main()
    20. {
    21. Contact_test01();
    22. return 0;
    23. }

     

    2.6 通讯录修改联系人信息 

    Contact.h

    1. //6.通讯录修改数据
    2. void ContactModify(Contact* con);

    Contact.c  

    1. //6.通讯录修改数据
    2. void ContactModify(Contact* con)
    3. {
    4. printf("请输入你想要修改联系人的姓名:");
    5. char name[NAME_MAX];
    6. scanf("%s", name);
    7. int ret = FindbyName(con, name);
    8. if (ret < 0)
    9. {
    10. printf("抱歉,通讯录中没有这个联系人!\n");
    11. return;
    12. }
    13. printf("请输入你想修改后联系人的姓名:");
    14. scanf("%s", con->arr[ret].name);
    15. printf("请输入你想修改后联系人的性别:");
    16. scanf("%s", con->arr[ret].gender);
    17. printf("请输入你想修改后联系人的年龄:");
    18. scanf("%d", &con->arr[ret].age);
    19. printf("请输入你想修改后联系人的电话:");
    20. scanf("%s", con->arr[ret].tel);
    21. printf("请输入你想修改后联系人的地址:");
    22. scanf("%s", con->arr[ret].addr);
    23. }

    test.c

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "SeqList.h"
    3. #include "Contact.h"
    4. Contact_test01()
    5. {
    6. Contact con;
    7. //1.通讯录得初始化
    8. ContactInit(&con);
    9. //4.尾插联系人信息
    10. ContactAdd(&con);
    11. //3.展示所以联系人信息
    12. ShowContact(&con);
    13. //5.删除联系人信息
    14. ContactDel(&con);
    15. ShowContact(&con);
    16. //6.修改联系人的信息
    17. ContactModify(&con);
    18. ShowContact(&con);
    19. //2.通讯录的销毁
    20. ContactDestroy(&con);
    21. }
    22. int main()
    23. {
    24. Contact_test01();
    25. return 0;
    26. }

    2.7 通讯录的查找联系人信息

    Contact.h 

    1. //7.通讯录的查找
    2. void ContactFind(Contact * con);

    Contact.c 

    1. //7.查找联系人的信息
    2. void ContactFind(Contact* con)
    3. {
    4. printf("请输入你想要查找联系人的姓名:");
    5. char name[NAME_MAX];
    6. scanf("%s", name);
    7. int ret = FindbyName(con, name);
    8. if (ret < 0)
    9. {
    10. printf("没有这个联系人的信息!");
    11. return;
    12. }
    13. //开始打印
    14. printf("%s %s %s %s %s\n", "姓名", "性别", "年龄", "电话", "地址");
    15. printf("%3s %4s %4d %4s %4s\n",
    16. con->arr[ret].name,
    17. con->arr[ret].gender,
    18. con->arr[ret].age,
    19. con->arr[ret].tel,
    20. con->arr[ret].addr
    21. );
    22. }

    test.c

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "SeqList.h"
    3. #include "Contact.h"
    4. Contact_test01()
    5. {
    6. Contact con;
    7. //1.通讯录得初始化
    8. ContactInit(&con);
    9. //4.尾插联系人信息
    10. ContactAdd(&con);
    11. //3.展示所以联系人信息
    12. ShowContact(&con);
    13. //5.删除联系人信息
    14. ContactDel(&con);
    15. ShowContact(&con);
    16. //6.修改联系人的信息
    17. ContactModify(&con);
    18. ShowContact(&con);
    19. //7.查找联系人的信息
    20. ContactFind(&con);
    21. //2.通讯录的销毁
    22. ContactDestroy(&con);
    23. }
    24. int main()
    25. {
    26. Contact_test01();
    27. return 0;
    28. }

    2.8 将通讯录中联系人信息保存到文件中 

    Contact.h

    1. //8.将通讯录中的数据保存到文件中
    2. SaveContact(&con);

    Contact.c  

    1. //8.将通讯录的数据写入到文件中
    2. void SaveContact(Contact* con)
    3. {
    4. FILE* pf = fopen("contact.txt", "wb");
    5. assert(pf);
    6. for (int i = 0; i < con->size; i++)
    7. {
    8. fwrite(con->arr + i, sizeof(peoInfo), 1, pf);
    9. }
    10. printf("通讯录数据保存成功!\n");
    11. fclose(pf);
    12. pf = NULL;
    13. }

     

    2.9 从文件中读取数据到通讯录中

     Contact.h

    void LoadContact(Contact* con);
    

     Contact.c

    1. //9.从文件中读取数据到通讯录中
    2. void LoadContact(Contact* con)
    3. {
    4. FILE* pf = fopen("contact.txt", "rb");
    5. if (pf == NULL)
    6. {
    7. perror("fopen:");
    8. return;
    9. }
    10. //循环读取文件数据
    11. peoInfo info;
    12. while (fread(&info, sizeof(peoInfo), 1, pf))
    13. {
    14. SLPushBack(con, info);
    15. }
    16. printf("读取数据成功\n");
    17. fclose(pf);
    18. pf = NULL;
    19. }

    三、将上述代码做成一个小游戏 

     效果图如下:

    代码如下:

    SeqList.h

    1. #pragma once
    2. #include <stdio.h>
    3. #include <stdlib.h>
    4. #include <string.h>
    5. #include <assert.h>
    6. #include "Contact.h"
    7. //首先的创建顺序表的结构
    8. typedef peoInfo SLDataType;
    9. typedef struct SeqList
    10. {
    11. SLDataType* arr;
    12. int size;
    13. int capacity;
    14. }SL;
    15. //1.顺序表的声明
    16. void SLInit(SL* ps);
    17. //2.顺序表的销毁
    18. void SLDestroy(SL* ps);
    19. //3.打印顺序表
    20. void SLPrint(SL* ps);
    21. //4.尾部插入数据
    22. void SLPushBack(SL* ps, SLDataType x);
    23. //5.头插数据
    24. void SLPushFront(SL* ps, int x);
    25. //6.尾部删除数据
    26. void SLPopBack(SL* ps);
    27. //7.头部删除数据
    28. void SLPopFront(SL* ps);
    29. //8.在指定位置之前插入数据
    30. void SLInsert(SL* ps, int pos, int x);
    31. //9.删除指定位置的数据
    32. void SLErase(SL* ps, int pos);
    33. //10.在顺序表中查找指定的数据,如果存在则返回下标,没有则返回一个无效值
    34. void SLFind(SL* ps, int x, int* arr, int* p_count);

    SeqList.c

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "SeqList.h"
    3. //1.顺序表的初始化
    4. void SLInit(SL* ps)
    5. {
    6. ps->arr = NULL;
    7. ps->size = ps->capacity = 0;
    8. }
    9. //2.顺序表的销毁
    10. void SLDestroy(SL* ps)
    11. {
    12. if (ps != NULL)
    13. {
    14. free(ps->arr);
    15. ps->arr = NULL;
    16. }
    17. ps->size = ps->capacity = 0;
    18. }
    19. //3.打印顺序表
    20. //void SLPrint(SL* ps)
    21. //{
    22. // for (int i = 0; i < ps->size; i++)
    23. // {
    24. // printf("%d ", ps->arr[i]);
    25. // }
    26. // printf("\n");
    27. //}
    28. //判断空间是否足够
    29. void SLCheckCapicaty(SL* ps)
    30. {
    31. //插之前肯定要判断空间是否足够
    32. if (ps->size == ps->capacity)
    33. {
    34. //首先解决空间为0的问题
    35. int new_capicaty = (ps->capacity == 0 ? 4 : ps->capacity * 2);
    36. SLDataType* tmp = (SLDataType*)realloc(ps->arr, new_capicaty * sizeof(SLDataType));
    37. //此时已经扩容完毕,但是还得判断空间是否开辟成功
    38. if (tmp == NULL)
    39. {
    40. perror("realloc:");
    41. return;
    42. }
    43. ps->arr = tmp;
    44. ps->capacity = new_capicaty;
    45. }
    46. }
    47. //4.尾部插入数据
    48. void SLPushBack(SL* ps, SLDataType x)
    49. {
    50. //首先得先判断传入是否为空指针
    51. assert(ps);
    52. SLCheckCapicaty(ps);
    53. //尾插数据
    54. ps->arr[ps->size] = x;
    55. ps->size++;
    56. }
    57. //5.头插数据
    58. //void SLPushFront(SL* ps, int x)
    59. //{
    60. // //判断传入的指针不能是空指针
    61. // assert(ps);
    62. //
    63. // //判断空间是否足够
    64. // SLCheckCapicaty(ps);
    65. //
    66. // //此时向空间中插入数据,首先得先将顺序表中数据依次往后以一个单元格
    67. // for (int i = ps->size; i > 0; i--)
    68. // {
    69. // ps->arr[i] = ps->arr[i - 1];
    70. // }
    71. // //头部插入数据
    72. // ps->arr[0] = x;
    73. // ps->size++;
    74. //
    75. //}
    76. //6.尾部删除数据
    77. void SLPopBack(SL* ps)
    78. {
    79. //首先还是得先判断指针
    80. assert(ps);
    81. ps->size--;
    82. }
    83. //7.头部删除数据
    84. void SLPopFront(SL* ps)
    85. {
    86. assert(ps);
    87. for (int i = 0; i < ps->size - 1; i++)
    88. {
    89. ps->arr[i] = ps->arr[i + 1];
    90. }
    91. ps->size--;
    92. }
    93. //8.在指定位置之前插入数据
    94. //void SLInsert(SL* ps, int pos, int x)
    95. //{
    96. // assert(ps);
    97. // //首先得先判断空间是否足够
    98. // SLCheckCapicaty(ps);
    99. // //在指定位置插入数据
    100. // for (int i = ps->size; i > pos; i--)
    101. // {
    102. // ps->arr[i] = ps->arr[i - 1];
    103. // }
    104. // //此时开始插入数据
    105. // ps->arr[pos] = x;
    106. // ps->size++;
    107. //}
    108. //9.删除指定位置的数据
    109. void SLErase(SL* ps, int pos)
    110. {
    111. assert(ps);
    112. for (int i = pos; i < ps->size - 1; i++)
    113. {
    114. ps->arr[i] = ps->arr[i + 1];
    115. }
    116. ps->size--;
    117. }
    118. //10.在顺序表中查找指定的数据,如果存在则返回下标,没有则返回一个无效值
    119. //void SLFind(SL* ps, int x, int* arr, int* p_count)
    120. //{
    121. // assert(ps);
    122. // assert(ps->size);
    123. // for (int i = 0; i < ps->size; i++)
    124. // {
    125. // if (ps->arr[i] == x)
    126. // {
    127. // /*arr[*p_count] = i;*/
    128. // *(arr + *p_count) = i;
    129. // *p_count++;
    130. // }
    131. // }
    132. //}

     Contact.h

    1. #pragma once
    2. #define NAME_MAX 20
    3. #define GENDER_MAX 10
    4. #define TEL_MAX 20
    5. #define ADDR_MAX 100
    6. //定义联系人的数据结构
    7. //姓名, 性别,年龄 , 电话 , 地址
    8. typedef struct personInfo
    9. {
    10. char name[NAME_MAX];
    11. char gender[GENDER_MAX];
    12. int age;
    13. char tel[TEL_MAX];
    14. char addr[ADDR_MAX];
    15. }peoInfo;
    16. //首先得先给通讯录起个名字
    17. typedef struct SeqList Contact;
    18. //1.通讯录的初始化
    19. void ContactInit(Contact* con);
    20. //2.通讯录的销毁
    21. void ContactDestroy(Contact* con);
    22. //3.展示通讯录数据
    23. void ShowContact(Contact* con);
    24. //4.通讯录添加数据
    25. void ContactAdd(Contact* con);
    26. //5.通讯录删除数据
    27. void ContactDel(Contact* con);
    28. //6.通讯录修改数据
    29. void ContactModify(Contact* con);
    30. //7.通讯录的查找
    31. void ContactFind(Contact * con);
    32. //8.将通讯录的数据写入到文件中
    33. void SaveContact(Contact* con);
    34. //9.从文件中读取数据到通讯录中
    35. void LoadContact(Contact* con);

    Contact.c

    1. #define _CRT_SECURE_NO_WARNINGS 1
    2. #include "Contact.h"
    3. #include "SeqList.h"
    4. //1.通讯录的初始化
    5. void ContactInit(Contact* con)
    6. {
    7. //实际上就是对顺序表进行初始化
    8. SLInit(con);
    9. }
    10. //2.通讯录的销毁
    11. void ContactDestroy(Contact* con)
    12. {
    13. SLDestroy(con); //同上
    14. }
    15. //3. 展示通讯录数据
    16. void ShowContact(Contact* con)
    17. {
    18. //表头:姓名 性别 年龄 电话 地址
    19. printf("%s %s %s %s %s\n", "姓名", "性别", "年龄", "电话", "地址");
    20. //遍历通讯录,按照格式打印每个联系人的数据
    21. for (int i = 0; i < con->size; i++)
    22. {
    23. printf("%3s %4s %4d %4s %4s\n",
    24. con->arr[i].name,
    25. con->arr[i].gender,
    26. con->arr[i].age,
    27. con->arr[i].tel,
    28. con->arr[i].addr
    29. );
    30. }
    31. }
    32. //4.通讯录添加数据
    33. void ContactAdd(Contact* con)
    34. {
    35. //首先我们得获取用户输入的内容:姓名+性别+年龄+电话+地址
    36. peoInfo Info;
    37. printf("请输入你想要添加联系人的姓名:");
    38. scanf("%s", Info.name);
    39. printf("请输入你想要添加联系人的性别:");
    40. scanf("%s", Info.gender);
    41. printf("请输入你想要添加联系人的年龄:");
    42. scanf("%d", &Info.age);
    43. printf("请输入你想要添加联系人的电话:");
    44. scanf("%s", Info.tel);
    45. printf("请输入你想要添加联系人的地址:");
    46. scanf("%s", Info.addr);
    47. //获取到数据之后,就需要往通讯录中写入
    48. SLPushBack(con, Info);
    49. }
    50. int FindbyName(Contact* con, char name[])
    51. {
    52. for (int i = 0; i < con->size; i++)
    53. {
    54. if (strcmp(name, con->arr[i].name) == 0)
    55. {
    56. printf("找到了下标为:%d\n", i);
    57. return i;
    58. }
    59. }
    60. return -1;
    61. }
    62. //5.通讯录删除数据
    63. void ContactDel(Contact* con)
    64. {
    65. //想要删除,就需要将他给找出来
    66. printf("请输入你想要删除联系人得姓名:");
    67. char name[NAME_MAX];
    68. scanf("%s", name);
    69. int ret = FindbyName(con, name);
    70. if (ret < 0)
    71. {
    72. printf("要删除得联系人数据不存在!\n");
    73. return;
    74. }
    75. SLErase(con, ret);
    76. printf("删除成功!\n");
    77. }
    78. //6.通讯录修改数据
    79. void ContactModify(Contact* con)
    80. {
    81. printf("请输入你想要修改联系人的姓名:");
    82. char name[NAME_MAX];
    83. scanf("%s", name);
    84. int ret = FindbyName(con, name);
    85. if (ret < 0)
    86. {
    87. printf("抱歉,通讯录中没有这个联系人!\n");
    88. return;
    89. }
    90. printf("请输入你想修改后联系人的姓名:");
    91. scanf("%s", con->arr[ret].name);
    92. printf("请输入你想修改后联系人的性别:");
    93. scanf("%s", con->arr[ret].gender);
    94. printf("请输入你想修改后联系人的年龄:");
    95. scanf("%d", &con->arr[ret].age);
    96. printf("请输入你想修改后联系人的电话:");
    97. scanf("%s", con->arr[ret].tel);
    98. printf("请输入你想修改后联系人的地址:");
    99. scanf("%s", con->arr[ret].addr);
    100. }
    101. //7.查找联系人的信息
    102. void ContactFind(Contact* con)
    103. {
    104. printf("请输入你想要查找联系人的姓名:");
    105. char name[NAME_MAX];
    106. scanf("%s", name);
    107. int ret = FindbyName(con, name);
    108. if (ret < 0)
    109. {
    110. printf("没有这个联系人的信息!\n");
    111. return;
    112. }
    113. //开始打印
    114. printf("%s %s %s %s %s\n", "姓名", "性别", "年龄", "电话", "地址");
    115. printf("%3s %4s %4d %4s %4s\n",
    116. con->arr[ret].name,
    117. con->arr[ret].gender,
    118. con->arr[ret].age,
    119. con->arr[ret].tel,
    120. con->arr[ret].addr
    121. );
    122. }
    123. //9.从文件中读取数据到通讯录中
    124. void LoadContact(Contact* con)
    125. {
    126. FILE* pf = fopen("contact.txt", "rb");
    127. if (pf == NULL)
    128. {
    129. perror("fopen:");
    130. return;
    131. }
    132. //循环读取文件数据
    133. peoInfo info;
    134. while (fread(&info, sizeof(peoInfo), 1, pf))
    135. {
    136. SLPushBack(con, info);
    137. }
    138. printf("读取数据成功\n");
    139. fclose(pf);
    140. pf = NULL;
    141. }
    142. //8.将通讯录的数据写入到文件中
    143. void SaveContact(Contact* con)
    144. {
    145. FILE* pf = fopen("contact.txt", "wb");
    146. assert(pf);
    147. for (int i = 0; i < con->size; i++)
    148. {
    149. fwrite(con->arr + i, sizeof(peoInfo), 1, pf);
    150. }
    151. printf("通讯录数据保存成功!\n");
    152. fclose(pf);
    153. pf = NULL;
    154. }

    test.c

    1. void menu()
    2. {
    3. printf("****************通讯录******************\n");
    4. printf("******1.增加联系人 2.删除联系人******\n");
    5. printf("******3.修改联系人 4.查找联系人******\n");
    6. printf("******5.展示联系人 0.退出程序********\n");
    7. printf("****************************************\n");
    8. printf("****************************************\n");
    9. }
    10. int main()
    11. {
    12. /*Contact_test01();*/
    13. int input = 0;
    14. Contact con;
    15. //初始化
    16. ContactInit(&con);
    17. do
    18. {
    19. menu();
    20. printf("请输入你想要进行的操作:");
    21. scanf("%d", &input);
    22. switch (input)
    23. {
    24. case 1:
    25. ContactAdd(&con);
    26. break;
    27. case 2:
    28. ContactDel(&con);
    29. break;
    30. case 3:
    31. ContactModify(&con);
    32. break;
    33. case 4:
    34. ContactFind(&con);
    35. break;
    36. case 5:
    37. ShowContact(&con);
    38. break;
    39. default:
    40. break;
    41. }
    42. } while (input);
    43. //销毁
    44. ContactDestroy(&con);
    45. return 0;
    46. }


  • 相关阅读:
    前端工程化之小白眼中的前端开发 vs 实际的前端开发
    【毕业设计源码】基于小程序的中学校园管理系统
    Node.js和cnpm环境搭建
    NMap 使用技巧总结(二)
    csapp-attacklab(完美解决版)
    OneFormer: One Transformer to Rule Universal Image Segmentation论文笔记
    Spring MVC相关
    1.10 - 总线
    开源短信项目 platform-sms 发布了新版本 0.5.0
    数据结构链表之无头单向循环链表的实现
  • 原文地址:https://blog.csdn.net/2203_75422717/article/details/137976215