#T584. 绝对值排序
绝对值排序
Description
Input n (n <= 100) integers and sort them in descending order based on their absolute values before outputting. 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 each pair of 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
(注:由于"CodesOnline"是一个专有名词或品牌名称,通常保持原样不翻译。如果上下文需要进一步解释,可以添加注释说明其含义,例如"代码在线平台"。但在此处仅作直译处理。)