摘要: #include <iostream> #include <bits/stdc++.h> using namespace std; /* 桶排序思想: 把每个数组开辟的空间看作一个桶, 将与桶编号相同的数据存入桶中 1 3 5 7 9 8 6 4 2 10 数据b[] 开辟桶的个数大于数据最大值 第 阅读全文
posted @ 2024-11-10 09:50 最后一个还有我 阅读(11) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int paixu(int a[10]){ for(int i=0;i<10;i++){ for(int j=i+1;j<10;j++){ if(a[i]<a[j]){ swap(a[i],a[j]); } } } } 阅读全文
posted @ 2024-11-10 09:24 最后一个还有我 阅读(8) 评论(0) 推荐(0)