题解 1738: 排序

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

三种方法:sort()+multiset容器+递归函数

摘要:解题思路:注意事项:注意题目说可能有多组测试数据,所以要使用循环输入,我就是刚开始没注意,根本不知道自己代码哪里出问题了-_-参考代码://sort()#include<iostream>……

1738: 排序 (sort)

摘要:解题思路:使用sort()排序,注意使用头文件<bits/stdc++.h>或使用#include<algorithm>头文件sort(begin, end, cmp),其中b……

快速排序解决

摘要:解题思路:多组测试数据可以利用输入的返回值体现,当有输入n的操作的时候才进行对下一行n个数据进行排序注意事项:快排别写错,注意换行参考代码:#include<iostream>#inclu……

1738: 排序题解

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; int main() {     int……

1738-排序(由小到大*多数据排序)

摘要:解题思路:用数组储存数据,两个for循环遍历数据,比较大小交换位置注意事项:会用到new获取数组大小参考代码:#include <iostream>using namespace std;void s……

题解 1738: 排序

摘要:下面是选择排序 #include using namespace std; int a[5010]; int main() { int n; ……

1738: 排序 C++!

摘要:解题思路:std::sort   最坏时间复杂度0(nlogn)注意事项:参考代码:#includeusing namespace std;int a[5000];int main(){ int n;……
优质题解

保姆级教程(冒泡排序)

摘要:解题思路:冒泡排序;1.写好交换函数和判断函数                               2.在main函数中用new获取未知数组的大小并根据输入的数创建数组            ……

排序(c++ sort)

摘要:参考代码:#include<iostream>#include <algorithm>using namespace std;int main(){            int n;    whil……

1738: 排序(c++代码)

摘要:sort函数直接排,真不错 ```cpp #include #include using namespace std; int main() { int n; whil……