摘要: #include <stdio.h> // 交换变量 void swap(void *m, void *n, int size); int main(void) { /* * 定义两个变量,要求交换变量中记录的值 * 注意:交换的代码写在一个新的函数swap中 * */ int num1, num2 阅读全文
posted @ 2026-01-15 23:29 Zhuye_inking 阅读(3) 评论(0) 推荐(0)
摘要: 冒泡排序 #include <stdio.h> // 遍历数组 void printArr(int array[], int length); // 冒泡排序 void bubbleSort(int array[], int length); int main(void) { /* * 冒泡排序: 阅读全文
posted @ 2026-01-15 11:29 Zhuye_inking 阅读(7) 评论(0) 推荐(0)
摘要: 基本查找/顺序查找 #include <stdio.h> // 基本查找/顺序查找 int orderSearch(int array[], int length, int number); int main(void) { /* * 基本查找/顺序查找: * 从数组的0索引开始,依次向后查找 * 阅读全文
posted @ 2026-01-15 10:37 Zhuye_inking 阅读(6) 评论(0) 推荐(0)