#T787. 绝对值排序
绝对值排序
Description
Input n (n <= 100) integers, sort them in descending order based on their absolute values, and then output the result. The problem guarantees that for each test case, all numbers have distinct absolute values.
Input Format
The input consists of multiple test cases. Each test case occupies one line, where the first number is n, followed by n integers. The input ends when n = 0, and no further processing is required.
Output Format
For each test case, output the sorted result with two numbers separated by a single space. Each test case should occupy one line.
3 3 -4 2
4 0 1 2 -3
0
-4 3 2
-3 2 1 0
翻译结果
CodesOnline