摘要: //冒泡排序 //14个数字排序:14个数的组合:14*13/2=91次 理论上比较91次 ,实际只有39次进行了变量交换 #include <stdio.h> void bubble_sort(int arr[], int len) { int i, j, temp,ci=0,sjci=0; fo 阅读全文
posted @ 2021-06-21 19:12 myrj 阅读(220) 评论(0) 推荐(0) 编辑
摘要: //数组长度的检测方法 #include <stdio.h> int main() { int arr[] = { 22, 34, 3, 32, 82, 55, 89, 50, 37, 5, 64, 35, 9, 70 }; int len = (int) sizeof(arr) / sizeof( 阅读全文
posted @ 2021-06-21 07:44 myrj 阅读(816) 评论(0) 推荐(0) 编辑