题解 1169: 绝对值排序

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

筛选

暴力解法解决绝对值排序

摘要:解题思路:定义两个一样大小的数组,一个数组用来存放输入的数据,另一个数组则用来记录是否是负数的判断,然后对于第一个数组遍历,如果小于0,则转化为它的相反数,否则不做处理,然后使用冒泡排序或者选择排序(……

绝对值排序(水题)

摘要:```c #include #include int main(){ int n,a[101],i,j,t; while(~scanf("%d",&n)&&n!=0){//这里的结尾……

绝对值排序

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){      int n;      while(scanf("%d",&n)!=E……

帅气的题解

摘要:解题思路:sort()函数的调用注意事项:ask()函数的掌握参考代码:while True:    try:#加个try保险        a=list(map(int,input().strip(……

绝对值排序 入门级

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n; while(~scanf("%d",&n)){//写全 或者写为s……

1169: 绝对值排序(c++)

摘要:```cpp #include using namespace std; //自定义排序规则 bool cmp(int x,int y){ return fabs(x)>fabs(y……

1169: 绝对值排序

摘要:```cpp #include #include #define INT_MAX 2147483647 using namespace std; int main() { int……

C++STL之Priority_queue(优先队列)

摘要:解题思路:C++STL之Priority_queue(优先队列)注意事项:参考代码:#include<iostream>#include<queue>#include<vector>#include<……

1169基础解法(Python)

摘要:注意事项:因为sys.stdin直接读取输入流,则第一项是什么对我们而言不太重要,只需要判断这个列表是否为空即可因为是绝对值的大小排序,选用sorted()函数中的key参数设定排序的指标为abs()……