#T400. 绝对值排序

绝对值排序

Description

Input n (n <= 100) integers and sort them in descending order based on their absolute values.
The problem guarantees that for each test case, the absolute values of all numbers are distinct.

Input Format

There are multiple sets of input data. Each set 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 a space separating each pair of numbers.
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