摘要:
#include <bits/stdc++.h> using namespace std; int main() { //判断从未排序的第一项和排序好的进行比较,小于就交换,不小于就停止。 int num[]={3,5,1,8,2}; for(int i=1;i<5;i++) { for(int j 阅读全文
posted @ 2024-04-05 09:41
hanxuyao
阅读(18)
评论(0)
推荐(0)
摘要:
#include <bits/stdc++.h> using namespace std; int main() {//基本思想:从数组的未排序区域选出一个最小的数//把他与数组中的第一个元素交换位置//然后再从剩下的未排序区域中选出一个最小的元素//把它与数组中的第二个元素交换位置 int num 阅读全文
posted @ 2024-04-05 08:54
hanxuyao
阅读(16)
评论(0)
推荐(0)