题解 1169: 绝对值排序

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

筛选

绝对值排序利用set容器

摘要:解题思路:去掉重复使用set容器注意事项:参考代码:# include <iostream> # include <set> # include <math.h> using namespace……

用sort函数解决问题

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool cmp(int a,int b){ return abs(a)>abs(b……

动态数组解决绝对值排序

摘要:解题思路:难点在于数组的长度需要人为输入,采用动态数组解决。注意事项:参考代码:#include<iostream>> #include<cmath> using namespace std; ……

绝对值排序

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std; bool cmp(int a, int b);int main(){    int……

1169: 绝对值排序

摘要:C语言网刷题以来首次碰到用 pair 的题。#include<bits/stdc++.h> using namespace std;   bool cmp(pair<int,int> &a,pa……

一个笨方法

摘要:一个笨方法cpp ```cpp #include #include using namespace std; int main() { int n,x3[20][20],num[20]; ……

使用C++STL库中的优先队列

摘要:解题思路:使用C++中的STL库中的优先队列,使用结构体定义一个比较函数进行排序,之后在主函数中使用优先队列输出注意事项:注意结构体里边比较逻辑的写法,这是容易出错的地方参考代码:#include<i……